Skip to content

Commit

Permalink
minor simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis committed Jan 9, 2018
1 parent 657ffd2 commit 6f8caa4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/style/style.js
Expand Up @@ -989,11 +989,8 @@ class Style extends Evented {
if (!this.placement || placementChanged || symbolBucketsChanged) {
this.placement = placement;
this.collisionIndex = this.placement.collisionIndex;
this.placement.setRecent(browser.now());
} else {
this.placement.setRecent(browser.now());
this.placement.stale = placement.stale;
}
this.placement.setRecent(browser.now(), placement.stale);
}

if (symbolBucketsChanged) {
Expand Down
4 changes: 2 additions & 2 deletions src/symbol/placement.js
Expand Up @@ -369,8 +369,8 @@ class Placement {
return this.recentUntil > now;
}

setRecent(now: number) {
this.stale = false;
setRecent(now: number, stale: boolean) {
this.stale = stale;
this.recentUntil = now + this.fadeDuration;
}

Expand Down

0 comments on commit 6f8caa4

Please sign in to comment.