mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 08:17:30 +02:00
@@ -21,7 +21,8 @@ iD.behavior.Paste = function(context) {
|
||||
d3.event.preventDefault();
|
||||
if (context.inIntro()) return;
|
||||
|
||||
var mouse = context.mouse(),
|
||||
var baseGraph = context.graph(),
|
||||
mouse = context.mouse(),
|
||||
projection = context.projection,
|
||||
viewport = iD.geo.Extent(projection.clipExtent()).polygon();
|
||||
|
||||
@@ -61,7 +62,7 @@ iD.behavior.Paste = function(context) {
|
||||
delta = [ mouse[0] - center[0], mouse[1] - center[1] ];
|
||||
|
||||
context.perform(iD.actions.Move(newIDs, delta, projection));
|
||||
context.enter(iD.modes.Move(context, newIDs));
|
||||
context.enter(iD.modes.Move(context, newIDs, baseGraph));
|
||||
}
|
||||
|
||||
function paste() {
|
||||
|
||||
+8
-3
@@ -1,4 +1,4 @@
|
||||
iD.modes.Move = function(context, entityIDs) {
|
||||
iD.modes.Move = function(context, entityIDs, baseGraph) {
|
||||
var mode = {
|
||||
id: 'move',
|
||||
button: 'browse'
|
||||
@@ -64,8 +64,13 @@ iD.modes.Move = function(context, entityIDs) {
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
context.pop();
|
||||
context.enter(iD.modes.Select(context, entityIDs).suppressMenu(true));
|
||||
if (baseGraph) {
|
||||
while (context.graph() !== baseGraph) context.pop();
|
||||
context.enter(iD.modes.Browse(context));
|
||||
} else {
|
||||
context.pop();
|
||||
context.enter(iD.modes.Select(context, entityIDs).suppressMenu(true));
|
||||
}
|
||||
stopNudge();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user