From 66a0d0bdbdc3e0a2150c0269923a3ddb2a7f4875 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 24 Jan 2013 18:40:27 -0500 Subject: [PATCH] Center the radial menu on entities (fixes #483) Also, don't show it when finishing draw operations. --- js/id/modes/select.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/id/modes/select.js b/js/id/modes/select.js index b58a9d485..57d97817a 100644 --- a/js/id/modes/select.js +++ b/js/id/modes/select.js @@ -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)); } };