mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 23:44:47 +02:00
Fix radial menu tooltip positioning
This commit is contained in:
@@ -156,7 +156,7 @@ iD.modes.Select = function(context, selectedIDs) {
|
||||
context.map().on('drawn.select', selectElements);
|
||||
selectElements();
|
||||
|
||||
radialMenu = iD.ui.RadialMenu(operations);
|
||||
radialMenu = iD.ui.RadialMenu(context, operations);
|
||||
var show = d3.event && !suppressMenu;
|
||||
|
||||
if (show) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
iD.ui.RadialMenu = function(operations) {
|
||||
iD.ui.RadialMenu = function(context, operations) {
|
||||
var menu,
|
||||
center = [0, 0],
|
||||
tooltip;
|
||||
@@ -66,9 +66,10 @@ iD.ui.RadialMenu = function(operations) {
|
||||
.attr('class', 'tooltip-inner radial-menu-tooltip');
|
||||
|
||||
function mouseover(d, i) {
|
||||
var angle = a0 + i * a,
|
||||
dx = angle < 0 ? -200 : 0,
|
||||
dy = 0;
|
||||
var rect = context.surface().node().getBoundingClientRect(),
|
||||
angle = a0 + i * a,
|
||||
dx = rect.left - (angle < 0 ? 200 : 0),
|
||||
dy = rect.top;
|
||||
|
||||
tooltip
|
||||
.style('left', (r + 25) * Math.sin(angle) + dx + center[0] + 'px')
|
||||
|
||||
Reference in New Issue
Block a user