Merge branch 'master' of github.com:systemed/iD

This commit is contained in:
Tom MacWright
2013-02-04 17:20:34 -05:00
3 changed files with 17 additions and 15 deletions
+8
View File
@@ -117,6 +117,14 @@ g.vertex.selected .shadow {
/* midpoints */
.mode-draw-area g.midpoint,
.mode-draw-line g.midpoint,
.mode-add-area g.midpoint,
.mode-add-line g.midpoint,
.mode-add-point g.midpoint {
display: none;
}
g.midpoint .fill {
fill:#aaa;
}
+3 -12
View File
@@ -29,18 +29,9 @@ iD.behavior.DrawWay = function(context, wayId, index, mode, baseGraph) {
var loc = context.map().mouseCoordinates();
if (datum.type === 'node') {
if (datum.id === end.id) {
context.surface().selectAll('.way, .node')
.filter(function (d) { return d.id === end.id; })
.classed('active', true);
} else {
loc = datum.loc;
}
} else if (datum.type === 'midpoint' || datum.type === 'way') {
var way = datum.type === 'way' ?
datum :
context.entity(datum.ways[0].id);
loc = iD.geo.chooseIndex(way, d3.mouse(context.surface().node()), context).loc;
loc = datum.loc;
} else if (datum.type === 'way') {
loc = iD.geo.chooseIndex(datum, d3.mouse(context.surface().node()), context).loc;
}
context.replace(iD.actions.MoveNode(end.id, loc));
+6 -3
View File
@@ -33,8 +33,11 @@ iD.svg.Labels = function(projection) {
var font_sizes = label_stack.map(function(d) {
var style = iD.util.getStyle('text.' + d[0] + '.tag-' + d[1]);
var m = style && style.cssText.match("font-size: ([0-9]{1,2})px;");
if (!m) return default_size;
return parseInt(m[1], 10);
if (m) return parseInt(m[1], 10);
style = iD.util.getStyle('text.' + d[0]);
m = style && style.cssText.match("font-size: ([0-9]{1,2})px;");
if (m) return parseInt(m[1], 10);
return default_size;
});
var pointOffsets = [
@@ -281,7 +284,7 @@ iD.svg.Labels = function(projection) {
p = getAreaLabel(entity, width, font_size);
}
if (p) {
p.classes = entity.geometry(graph) + ' tag-' + label_stack[k].slice(1).join('-');
p.classes = entity.geometry(graph) + ' tag-' + label_stack[k][1];
positions[entity.geometry(graph)].push(p);
labelled[entity.geometry(graph)].push(entity);
}