Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Fix rendering 180° line joins #7786

Merged
merged 1 commit into from
Jan 23, 2017
Merged

Conversation

kkaefer
Copy link
Member

@kkaefer kkaefer commented Jan 19, 2017

Fixes #7778, a alternative fix for mapbox/mapbox-gl-js#4008

@lbud I am using a different fix: I found that computing the unit vector of (0, 0) on native returns a vector of (0, 0), while JS uses NaN. I investigated a little further and ultimately found that this makes miterLength NaN as well on JS. Instead of using NaN all the way down, this patch uses an explicit value of 0, and sets the miterLimit to Infinity in that case. This change also fixes the missing line caps we saw on native (which was also a result of the different way of computing unit(0, 0)).

I think we should port this change back to JS as well, since it removes division by zero.

@kkaefer kkaefer changed the title Fix rendering 180º line joins Fix rendering 180° line joins Jan 19, 2017
@kkaefer kkaefer force-pushed the 7778-acute-line-join-artifacts branch from af3c8e7 to b2de339 Compare January 19, 2017 15:43
Copy link
Contributor

@tmpsantos tmpsantos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@kkaefer kkaefer force-pushed the 7778-acute-line-join-artifacts branch from b2de339 to 3610f2e Compare January 23, 2017 10:30
@kkaefer
Copy link
Member Author

kkaefer commented Jan 23, 2017

Enabled test suite in mapbox/mapbox-gl-js@2663093

@kkaefer kkaefer merged commit a37ae27 into master Jan 23, 2017
@tmpsantos tmpsantos deleted the 7778-acute-line-join-artifacts branch January 23, 2017 16:32
1ec5 added a commit that referenced this pull request Feb 9, 2017
Added mention of #7786, #7989, #7902. Moved #7956 to the correct section.
1ec5 added a commit that referenced this pull request Feb 9, 2017
Added mention of #7786, #7989, #7902. Moved #7956 to the correct section.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port 180º + very acute line join fixes
2 participants