Remove cancel tool functionality

This commit is contained in:
Ryan Huffman 2014-10-28 11:21:26 -07:00
parent 21b6a93fef
commit e21bf78d04
2 changed files with 7 additions and 64 deletions

View file

@ -1091,15 +1091,8 @@ SelectionDisplay = (function () {
isConstrained = false; isConstrained = false;
}, },
onEnd: function(event, reason) { onEnd: function(event, reason) {
if (reason == 'cancel') { pushCommandForSelections(duplicatedEntityIDs);
for (var i = 0; i < SelectionManager.selections.length; i++) {
var entityID = SelectionManager.selections[i];
var initialProperties = SelectionManager.savedProperties[entityID.id];
Entities.editEntity(entityID, initialProperties);
}
} else {
pushCommandForSelections();
}
Overlays.editOverlay(xRailOverlay, { visible: false }); Overlays.editOverlay(xRailOverlay, { visible: false });
Overlays.editOverlay(zRailOverlay, { visible: false }); Overlays.editOverlay(zRailOverlay, { visible: false });
}, },
@ -1162,15 +1155,7 @@ SelectionDisplay = (function () {
SelectionManager.saveProperties(); SelectionManager.saveProperties();
}, },
onEnd: function(event, reason) { onEnd: function(event, reason) {
if (reason == 'cancel') { pushCommandForSelections();
for (var i = 0; i < SelectionManager.selections.length; i++) {
var entityID = SelectionManager.selections[i];
var initialProperties = SelectionManager.savedProperties[entityID.id];
Entities.editEntity(entityID, initialProperties);
}
} else {
pushCommandForSelections();
}
}, },
onMove: function(event) { onMove: function(event) {
pickRay = Camera.computePickRay(event.x, event.y); pickRay = Camera.computePickRay(event.x, event.y);
@ -1321,15 +1306,7 @@ SelectionDisplay = (function () {
Overlays.editOverlay(yRailOverlay, { visible: false }); Overlays.editOverlay(yRailOverlay, { visible: false });
Overlays.editOverlay(zRailOverlay, { visible: false }); Overlays.editOverlay(zRailOverlay, { visible: false });
if (reason == 'cancel') { pushCommandForSelections();
for (var i = 0; i < SelectionManager.selections.length; i++) {
var entityID = SelectionManager.selections[i];
var initialProperties = SelectionManager.savedProperties[entityID.id];
Entities.editEntity(entityID, initialProperties);
}
} else {
pushCommandForSelections();
}
}; };
var onMove = function(event) { var onMove = function(event) {
@ -1425,14 +1402,6 @@ SelectionDisplay = (function () {
}; };
}; };
that.cancelTool = function() {
if (activeTool) {
activeTool.onEnd(null, 'cancel');
activeTool = null;
SelectionManager._update();
}
};
function addStretchTool(overlay, mode, pivot, direction) { function addStretchTool(overlay, mode, pivot, direction) {
if (!pivot) { if (!pivot) {
pivot = Vec3.multiply(-1, direction); pivot = Vec3.multiply(-1, direction);
@ -1518,15 +1487,7 @@ SelectionDisplay = (function () {
Overlays.editOverlay(rotateOverlayOuter, { visible: false }); Overlays.editOverlay(rotateOverlayOuter, { visible: false });
Overlays.editOverlay(rotateOverlayCurrent, { visible: false }); Overlays.editOverlay(rotateOverlayCurrent, { visible: false });
if (reason == 'cancel') { pushCommandForSelections();
for (var i = 0; i < SelectionManager.selections.length; i++) {
var entityID = SelectionManager.selections[i];
var initialProperties = SelectionManager.savedProperties[entityID.id];
Entities.editEntity(entityID, initialProperties);
}
} else {
pushCommandForSelections();
}
}, },
onMove: function(event) { onMove: function(event) {
var debug = Menu.isOptionChecked("Debug Ryans Rotation Problems"); var debug = Menu.isOptionChecked("Debug Ryans Rotation Problems");
@ -1658,15 +1619,7 @@ SelectionDisplay = (function () {
Overlays.editOverlay(rotateOverlayOuter, { visible: false }); Overlays.editOverlay(rotateOverlayOuter, { visible: false });
Overlays.editOverlay(rotateOverlayCurrent, { visible: false }); Overlays.editOverlay(rotateOverlayCurrent, { visible: false });
if (reason == 'cancel') { pushCommandForSelections();
for (var i = 0; i < SelectionManager.selections.length; i++) {
var entityID = SelectionManager.selections[i];
var initialProperties = SelectionManager.savedProperties[entityID.id];
Entities.editEntity(entityID, initialProperties);
}
} else {
pushCommandForSelections();
}
}, },
onMove: function(event) { onMove: function(event) {
var debug = Menu.isOptionChecked("Debug Ryans Rotation Problems"); var debug = Menu.isOptionChecked("Debug Ryans Rotation Problems");
@ -1796,15 +1749,7 @@ SelectionDisplay = (function () {
Overlays.editOverlay(rotateOverlayOuter, { visible: false }); Overlays.editOverlay(rotateOverlayOuter, { visible: false });
Overlays.editOverlay(rotateOverlayCurrent, { visible: false }); Overlays.editOverlay(rotateOverlayCurrent, { visible: false });
if (reason == 'cancel') { pushCommandForSelections();
for (var i = 0; i < SelectionManager.selections.length; i++) {
var entityID = SelectionManager.selections[i];
var initialProperties = SelectionManager.savedProperties[entityID.id];
Entities.editEntity(entityID, initialProperties);
}
} else {
pushCommandForSelections();
}
}, },
onMove: function(event) { onMove: function(event) {
var debug = Menu.isOptionChecked("Debug Ryans Rotation Problems"); var debug = Menu.isOptionChecked("Debug Ryans Rotation Problems");

View file

@ -659,8 +659,6 @@ Controller.keyReleaseEvent.connect(function (event) {
handeMenuEvent("Delete"); handeMenuEvent("Delete");
} else if (event.text == "TAB") { } else if (event.text == "TAB") {
selectionDisplay.toggleSpaceMode(); selectionDisplay.toggleSpaceMode();
} else if (event.text == "ESC") {
selectionDisplay.cancelTool();
} else if (event.text == "f") { } else if (event.text == "f") {
if (entitySelected) { if (entitySelected) {
// Get latest properties // Get latest properties