Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StrokeStyle should not use a Vec internally #416

Closed
cmyr opened this issue Mar 16, 2021 · 0 comments · Fixed by #417
Closed

StrokeStyle should not use a Vec internally #416

cmyr opened this issue Mar 16, 2021 · 0 comments · Fixed by #417
Labels
enhancement New feature or request

Comments

@cmyr
Copy link
Member

cmyr commented Mar 16, 2021

We would like this to be something that is cheap to clone and hold on to, so I think I'd prefer to store an Rc<[]> internally.

I also might split up the dash_offset and dash_lengths into separate fields. 🤷

Originally posted by @cmyr in linebender/druid#1647 (comment)

@cmyr cmyr added the enhancement New feature or request label Mar 16, 2021
cmyr added a commit that referenced this issue Mar 16, 2021
This started out as my just wanting to fix #416 while it was
on my mind, and then, well, things got a little out of hand.

I realized I wasn't familiar with some of the terminology used,
so I patched up the docs based on the postscript manual. Then
I noticed there were a few areas where the API seemed confusing,
and where the backends had to duplicate a bunch of code in order
to set defaults, so I went through and implemented `Default`,
using the defaults mentioned in the spec.

Highlights:

- 'dash' is replaced with separate 'dash_pattern' and 'dash_offset'
  methods
- StrokeStyle can now be constructed in a const context
- dash pattern can now be represented with a static &[f64] slice
- miter limit is now a member of the LineJoin::Miter variant.
- LineCap::Square is replaced with LineCap::ProjectingSquare, which
  more closely matches the naming in postscript and hopefully helps
  to differentiate it from LineCap::Butt.
cmyr added a commit that referenced this issue Mar 23, 2021
This started out as my just wanting to fix #416 while it was
on my mind, and then, well, things got a little out of hand.

I realized I wasn't familiar with some of the terminology used,
so I patched up the docs based on the postscript manual. Then
I noticed there were a few areas where the API seemed confusing,
and where the backends had to duplicate a bunch of code in order
to set defaults, so I went through and implemented `Default`,
using the defaults mentioned in the spec.

Highlights:

- 'dash' is replaced with separate 'dash_pattern' and 'dash_offset'
  methods
- StrokeStyle can now be constructed in a const context
- dash pattern can now be represented with a static &[f64] slice
- miter limit is now a member of the LineJoin::Miter variant.
- LineCap::Square is replaced with LineCap::ProjectingSquare, which
  more closely matches the naming in postscript and hopefully helps
  to differentiate it from LineCap::Butt.
cmyr added a commit that referenced this issue Mar 26, 2021
This started out as my just wanting to fix #416 while it was
on my mind, and then, well, things got a little out of hand.

I realized I wasn't familiar with some of the terminology used,
so I patched up the docs based on the postscript manual. Then
I noticed there were a few areas where the API seemed confusing,
and where the backends had to duplicate a bunch of code in order
to set defaults, so I went through and implemented `Default`,
using the defaults mentioned in the spec.

Highlights:

- 'dash' is replaced with separate 'dash_pattern' and 'dash_offset'
  methods
- StrokeStyle can now be constructed in a const context
- dash pattern can now be represented with a static &[f64] slice
- miter limit is now a member of the LineJoin::Miter variant.
@cmyr cmyr closed this as completed in #417 Mar 26, 2021
cmyr added a commit that referenced this issue Mar 26, 2021
This started out as my just wanting to fix #416 while it was
on my mind, and then, well, things got a little out of hand.

I realized I wasn't familiar with some of the terminology used,
so I patched up the docs based on the postscript manual. Then
I noticed there were a few areas where the API seemed confusing,
and where the backends had to duplicate a bunch of code in order
to set defaults, so I went through and implemented `Default`,
using the defaults mentioned in the spec.

Highlights:

- 'dash' is replaced with separate 'dash_pattern' and 'dash_offset'
  methods
- StrokeStyle can now be constructed in a const context
- dash pattern can now be represented with a static &[f64] slice
- miter limit is now a member of the LineJoin::Miter variant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant