Skip to content

fix line decimation for segments crossing the viewport #2705

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

Merged
merged 2 commits into from
Jun 7, 2018

Conversation

alexcjohnson
Copy link
Collaborator

Fixes #2664 - the problem was the increasing decimation tolerance as points get farther from the viewport - if a segment crosses the viewport we need to use the on-screen (minimum) tolerance even though points on both sides are far enough away to get a high tolerance. Adds a little extra calculation into the decimation algorithm unfortunately, but I don't think it's too big a hit (nor do I see any higher-performance alternative).

cc @etpinard

@@ -472,6 +474,47 @@ describe('Test scatter', function() {
expect(ptsOut2[0]).toBeCloseTo2DArray(ptsExpected[i].map(reverseXY), 1, i);
});
});

it('works when far off-screen points cross the viewport', function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nicely done. 💃

@alexcjohnson alexcjohnson merged commit 95c88e6 into master Jun 7, 2018
@alexcjohnson alexcjohnson deleted the decimation-fix branch June 7, 2018 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants