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

stroke sets the fill rule attribute to a default value, so it can't be changed later #26

Closed
fryguybob opened this issue Aug 4, 2012 · 2 comments

Comments

@fryguybob
Copy link
Member

(Imported from http://code.google.com/p/diagrams/issues/detail?id=52. Original issue from byor...@gmail.com on September 8, 2011, 12:37:25 AM UTC)

One might expect to be able to say something like

stroke p # fillRule EvenOdd

but currently this does not work, since stroke is defined as stroke' def, and stroke' takes a record of options including a fill rule, which it uses to create the proper Query as well as set a FillRule attribute. So (stroke p) results in the FillRule attribute being implicitly set to the default fill rule, and subsequent calls to fillRule do not affect it.

The problem is that if we want the fill rule to affect the Query, it must be done at the time that stroke' is called. I can think of several options:

  • stroke' uses the provided FillRule to create the Query only, and does not call fillRule to set a FillRule attribute. However, this leads to unintuitive behavior: calling stroke' with a FillRule won't cause it to be drawn using that FillRule, and conversely using (# fillRule blah) won't affect the Query.
  • make the type of the stroke' record field (Maybe FillRule) and have Nothing be the default. But this is also somewhat unintuitive, since the Query has to be created (using some default) anyway.
  • another possibility is to make the fill rule an inherent property of the Path type itself. But it would be strange to have this particular attribute singled out; and abstractly, Paths have nothing to do with fill rules. Fill rules don't even make sense for paths in dimensions other than 2 anyway.

Other suggestions welcome...

@fryguybob
Copy link
Member Author

(Imported. Original comment by byor...@gmail.com on September 8, 2011, 12:58:43 AM UTC)

I'm implementing option #1 for now, but leaving this open since I am not convinced it's necessarily the best.

@fryguybob
Copy link
Member Author

(Imported. Original comment by byor...@gmail.com on March 12, 2012, 03:02:45 AM UTC)

Closing this, since it doesn't correspond to a concrete action that needs to be taken. If we ever want to revisit this we can reopen it, or open a new ticket and link back to this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant