Center the radial menu on entities (fixes #483)

Also, don't show it when finishing draw operations.
This commit is contained in:
John Firebaugh
2013-01-24 18:40:27 -05:00
parent 6017b9b752
commit 66a0d0bdbd
+10 -2
View File
@@ -133,8 +133,16 @@ iD.modes.Select = function(entity, initial) {
radialMenu = iD.ui.RadialMenu(entity, history);
if (d3.event) {
surface.call(radialMenu, d3.mouse(surface.node()));
if (d3.event && !initial) {
var loc = map.mouseCoordinates();
if (entity.type === 'node') {
loc = entity.loc;
} else if (entity.type === 'way') {
loc = iD.geo.chooseIndex(entity, d3.mouse(map.surface.node()), map).loc;
}
surface.call(radialMenu, map.projection(loc));
}
};