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

fix line decimation for segments crossing the viewport #2705

Merged
merged 2 commits into from Jun 7, 2018

Conversation

Projects
None yet
2 participants
@alexcjohnson
Contributor

alexcjohnson commented Jun 7, 2018

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

alexcjohnson added some commits Jun 7, 2018

@@ -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() {

This comment has been minimized.

@etpinard

etpinard Jun 7, 2018

Member

Nicely done. 💃

@etpinard

etpinard Jun 7, 2018

Member

Nicely done. 💃

@alexcjohnson alexcjohnson merged commit 95c88e6 into master Jun 7, 2018

6 checks passed

ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: test-image Your tests passed on CircleCI!
Details
ci/circleci: test-image2 Your tests passed on CircleCI!
Details
ci/circleci: test-jasmine Your tests passed on CircleCI!
Details
ci/circleci: test-jasmine2 Your tests passed on CircleCI!
Details
ci/circleci: test-syntax Your tests passed on CircleCI!
Details

@alexcjohnson alexcjohnson deleted the decimation-fix branch Jun 7, 2018

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