mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
fix crash on low zoom address rendering
This commit is contained in:
@@ -321,7 +321,7 @@ export function svgLabels(projection, context) {
|
||||
|
||||
var getName = (geometry === 'line') ? utilDisplayNameForPath : utilDisplayName;
|
||||
var name = getName(entity);
|
||||
var width = name && textWidth(name, fontSize, selection.select('g.layer-osm.labels g.label').node());
|
||||
var width = name && textWidth(name, fontSize, selection.select('g.layer-osm.labels').node());
|
||||
var p = null;
|
||||
|
||||
if (geometry === 'point' || geometry === 'vertex') {
|
||||
@@ -332,7 +332,7 @@ export function svgLabels(projection, context) {
|
||||
if (renderAs.geometry === 'vertex' && zoom < 17) continue;
|
||||
while (renderAs.isAddr && width > 36) {
|
||||
name = `${name.substring(0, name.replace(/…$/, '').length - 1)}…`;
|
||||
width = textWidth(name, fontSize, selection.select('g.layer-osm.labels g.label').node());
|
||||
width = textWidth(name, fontSize, selection.select('g.layer-osm.labels').node());
|
||||
}
|
||||
|
||||
p = getPointLabel(entity, width, fontSize, renderAs);
|
||||
|
||||
Reference in New Issue
Block a user