mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
Fix several small label related bugs
This commit is contained in:
+4
-4
@@ -586,18 +586,18 @@ text.pointlabel {
|
||||
|
||||
.pointlabel-halo,
|
||||
.linelabel-halo,
|
||||
.area-halo {
|
||||
.arealabel-halo {
|
||||
opacity: 0.7;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
||||
text.area-leisure-park {
|
||||
text.area.tag-leisure-park {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
text.point-shop,
|
||||
text.point-amenity {
|
||||
text.point.tag-shop,
|
||||
text.point.tag-amenity {
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
|
||||
+8
-5
@@ -12,16 +12,17 @@ iD.svg.Labels = function(projection) {
|
||||
|
||||
var default_size = 12;
|
||||
var font_sizes = label_stack.map(function(d) {
|
||||
var style = iD.util.getStyle('text.' + d.join('-'));
|
||||
var style = iD.util.getStyle(
|
||||
'text.' + d[0] + '.tag-' + d.slice(1).join('-'));
|
||||
var m = style && style.cssText.match("font-size: ([0-9]{1,2})px;");
|
||||
if (!m) return default_size;
|
||||
return parseInt(m[1], 10);
|
||||
});
|
||||
|
||||
var pointOffsets = [
|
||||
[10, 3, 'start'], // right
|
||||
[10, 0, 'start'],
|
||||
[-15, 0, 'end'], // left
|
||||
[15, 3, 'start'], // right
|
||||
[10, 0, 'start'], // unused right now
|
||||
[-15, 0, 'end']
|
||||
];
|
||||
|
||||
var lineOffsets = [
|
||||
@@ -103,6 +104,8 @@ iD.svg.Labels = function(projection) {
|
||||
return x;
|
||||
},
|
||||
'y': function(d, i) { return labels[i]['y'] - labels[i]['height'] + 1 - 2; },
|
||||
'rx': 3,
|
||||
'ry': 3,
|
||||
'width': function(d, i) { return textWidth(d.tags.name, labels[i]['height']) + 4 },
|
||||
'height': function(d, i) { return labels[i]['height'] + 4 },
|
||||
'fill': 'white',
|
||||
@@ -231,7 +234,7 @@ iD.svg.Labels = function(projection) {
|
||||
p = getAreaLabel(entity, width, font_size);
|
||||
}
|
||||
if (p) {
|
||||
p.classes = label_stack[k].join('-');
|
||||
p.classes = entity.geometry() + ' tag-' + label_stack[k].slice(1).join('-');
|
||||
positions[entity.geometry()].push(p);
|
||||
labelled[entity.geometry()].push(entity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user