mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 22:30:43 +02:00
Reorganize selectionManager selection checking
This commit is contained in:
parent
dde9b92dbd
commit
2fab404f7f
1 changed files with 38 additions and 41 deletions
|
@ -1024,9 +1024,7 @@ PropertiesTool = function(opts) {
|
|||
selectionManager._update();
|
||||
} else if (data.type == "action") {
|
||||
if (data.action == "moveSelectionToGrid") {
|
||||
if (!selectionManager.hasSelection()) {
|
||||
return;
|
||||
}
|
||||
if (selectionManager.hasSelection()) {
|
||||
selectionManager.saveProperties();
|
||||
var dY = grid.getOrigin().y - (selectionManager.worldPosition.y - selectionManager.worldDimensions.y / 2),
|
||||
var diff = { x: 0, y: dY, z: 0 };
|
||||
|
@ -1039,10 +1037,9 @@ PropertiesTool = function(opts) {
|
|||
}
|
||||
pushCommandForSelections();
|
||||
selectionManager._update();
|
||||
} else if (data.action == "moveAllToGrid") {
|
||||
if (!selectionManager.hasSelection()) {
|
||||
return;
|
||||
}
|
||||
} else if (data.action == "moveAllToGrid") {
|
||||
if (selectionManager.hasSelection()) {
|
||||
selectionManager.saveProperties();
|
||||
for (var i = 0; i < selectionManager.selections.length; i++) {
|
||||
var properties = selectionManager.savedProperties[selectionManager.selections[i].id];
|
||||
|
@ -1056,10 +1053,9 @@ PropertiesTool = function(opts) {
|
|||
}
|
||||
pushCommandForSelections();
|
||||
selectionManager._update();
|
||||
} else if (data.action == "resetToNaturalDimensions") {
|
||||
if (!selectionManager.hasSelection()) {
|
||||
return;
|
||||
}
|
||||
} else if (data.action == "resetToNaturalDimensions") {
|
||||
if (selectionManager.hasSelection()) {
|
||||
selectionManager.saveProperties();
|
||||
for (var i = 0; i < selectionManager.selections.length; i++) {
|
||||
var properties = selectionManager.savedProperties[selectionManager.selections[i].id];
|
||||
|
@ -1071,6 +1067,7 @@ PropertiesTool = function(opts) {
|
|||
selectionManager._update();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return that;
|
||||
|
|
Loading…
Reference in a new issue