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

Half-dart arrowheads #234

Merged
merged 6 commits into from
Feb 19, 2015
Merged

Half-dart arrowheads #234

merged 6 commits into from
Feb 19, 2015

Conversation

byorgey
Copy link
Member

@byorgey byorgey commented Feb 19, 2015

Add half-dart arrowheads. Along the way, fix three latent arrow[head] bugs which were much harder to notice with symmetric arrowheads. See individual commits and their comments to understand the bugs and their fixes.

The line width was still Measured in the style, so simply
applying 'getAttr' was always returning Nothing and a default
line width was being used, so setting the line width had no
effect on arrow shafts.  The fix is to use unmeasureAttrs to
first resolve Measured attributes before calling getAttr.
Previously it was only taking the line color from the global style.
Now we simply apply the entire global style to the shaft style.
Anything explicitly set in the shaft style will take precedence,
but this means the shaft and joint now pick up not only the ambient
line color but also the line width, so you can do things like

  arrow ... # lw thick # lc red

and it will "just work".
Previously arrowheads were unaffected by reflections, which no one
ever noticed because we never had any asymmetric arrowheads.
mkHead and mkTail were almost identical.  Please don't make me
write down the type of mkHT.
@jeffreyrosenbluth
Copy link
Member

@byorgey I do find these bugs interesting, I am really surprised there were so many. Arrows have gotten increasingly complicated since we first build the module. Maybe you could walk me through your debugging process. I guess you just need to add a type signature to mkHT and we are good to go.

Nice work
:D

@byorgey
Copy link
Member Author

byorgey commented Feb 19, 2015

There is nothing really mysterious/special about my debugging process, just trying lots of examples, attempting to understand carefully where various values are coming from, seeing which code paths are being taken by e.g. inserting traceShow or inserting special values, etc. Also taking breaks when I got frustrated and coming back to it later.

Re: type signature for mkHT, haha, I forgot we even have -Werror tured on for Travis. Well, here goes...

jeffreyrosenbluth added a commit that referenced this pull request Feb 19, 2015
@jeffreyrosenbluth jeffreyrosenbluth merged commit 1877e88 into master Feb 19, 2015
@jeffreyrosenbluth jeffreyrosenbluth deleted the halfdart branch February 19, 2015 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants