mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 21:28:11 +02:00
Enable rotating selection even when mouse isn't over the map (re: #8187)
This commit is contained in:
@@ -50,7 +50,7 @@ export function modeRotate(context, entityIDs) {
|
||||
var _pivot;
|
||||
|
||||
|
||||
function doRotate() {
|
||||
function doRotate(d3_event) {
|
||||
var fn;
|
||||
if (context.graph() !== _prevGraph) {
|
||||
fn = context.perform;
|
||||
@@ -73,7 +73,7 @@ export function modeRotate(context, entityIDs) {
|
||||
}
|
||||
|
||||
|
||||
var currMouse = context.map().mouse();
|
||||
var currMouse = context.map().mouse(d3_event);
|
||||
var currAngle = Math.atan2(currMouse[1] - _pivot[1], currMouse[0] - _pivot[0]);
|
||||
|
||||
if (typeof _prevAngle === 'undefined') _prevAngle = currAngle;
|
||||
|
||||
@@ -710,7 +710,7 @@ export function rendererMap(context) {
|
||||
|
||||
|
||||
map.mouse = function(d3_event) {
|
||||
var event = _lastPointerEvent || d3_event;
|
||||
var event = d3_event || _lastPointerEvent;
|
||||
if (event) {
|
||||
var s;
|
||||
while ((s = event.sourceEvent)) { event = s; }
|
||||
|
||||
@@ -447,7 +447,8 @@ export function utilFastMouse(container) {
|
||||
return function(e) {
|
||||
return [
|
||||
e.clientX - rectLeft - clientLeft,
|
||||
e.clientY - rectTop - clientTop];
|
||||
e.clientY - rectTop - clientTop
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user