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

Fix line distances breaking gradient across tile boundaries #9220

Merged
merged 3 commits into from
Jan 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address review comments
karimnaaji committed Jan 22, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit f7c33dfcd0442cd470a19cdc0993c2bd31161d1c
8 changes: 2 additions & 6 deletions src/data/bucket/line_bucket.js
Original file line number Diff line number Diff line change
@@ -334,7 +334,6 @@ class LineBucket implements Bucket {
if (prevSegmentLength > 2 * sharpCornerOffset) {
const newPrevVertex = currentVertex.sub(currentVertex.sub(prevVertex)._mult(sharpCornerOffset / prevSegmentLength)._round());
this.updateDistance(prevVertex, newPrevVertex);
this.updateScaledDistance();
this.addCurrentVertex(newPrevVertex, prevNormal, 0, 0, segment);
prevVertex = newPrevVertex;
}
@@ -367,10 +366,7 @@ class LineBucket implements Bucket {
}

// Calculate how far along the line the currentVertex is
if (prevVertex) {
this.updateDistance(prevVertex, currentVertex);
this.updateScaledDistance();
}
if (prevVertex) this.updateDistance(prevVertex, currentVertex);

if (currentJoin === 'miter') {

@@ -459,7 +455,6 @@ class LineBucket implements Bucket {
if (nextSegmentLength > 2 * sharpCornerOffset) {
const newCurrentVertex = currentVertex.add(nextVertex.sub(currentVertex)._mult(sharpCornerOffset / nextSegmentLength)._round());
this.updateDistance(currentVertex, newCurrentVertex);
this.updateScaledDistance();
this.addCurrentVertex(newCurrentVertex, nextNormal, 0, 0, segment);
currentVertex = newCurrentVertex;
}
@@ -544,6 +539,7 @@ class LineBucket implements Bucket {

updateDistance(prev: Point, next: Point) {
this.distance += prev.dist(next);
this.updateScaledDistance();
}
karimnaaji marked this conversation as resolved.
Show resolved Hide resolved
}