Skip to content

Commit

Permalink
Reset temp placement variable each loop iteration
Browse files Browse the repository at this point in the history
(closes #4473)

Otherwise `if (p)` will have stale data and be truthy for vertices at low zoom
  • Loading branch information
bhousel committed Nov 15, 2017
1 parent 3ba25ea commit 38920b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/svg/labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export function svgLabels(projection, context) {
var getName = (geometry === 'line') ? utilDisplayNameForPath : utilDisplayName,
name = getName(entity),
width = name && textWidth(name, fontSize),
p;
p = null;

if (geometry === 'point') {
p = getPointLabel(entity, width, fontSize, geometry);
Expand Down

0 comments on commit 38920b2

Please sign in to comment.