mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 09:25:31 +02:00
Merge pull request #4286 from huffman/fix-nat-dims
Fix "reset to natural dimensions" when dimensions not known
This commit is contained in:
commit
f6ff0665ca
1 changed files with 12 additions and 3 deletions
|
@ -959,9 +959,18 @@ PropertiesTool = function(opts) {
|
|||
selectionManager.saveProperties();
|
||||
for (var i = 0; i < selectionManager.selections.length; i++) {
|
||||
var properties = selectionManager.savedProperties[selectionManager.selections[i].id];
|
||||
Entities.editEntity(selectionManager.selections[i], {
|
||||
dimensions: properties.naturalDimensions,
|
||||
});
|
||||
var naturalDimensions = properties.naturalDimensions;
|
||||
|
||||
// If any of the natural dimensions are not 0, resize
|
||||
if (properties.type == "Model" && naturalDimensions.x == 0
|
||||
&& naturalDimensions.y == 0 && naturalDimensions.z == 0) {
|
||||
Window.alert("Cannot reset entity to its natural dimensions: Model URL"
|
||||
+ " is invalid or the model has not yet been loaded.");
|
||||
} else {
|
||||
Entities.editEntity(selectionManager.selections[i], {
|
||||
dimensions: properties.naturalDimensions,
|
||||
});
|
||||
}
|
||||
}
|
||||
pushCommandForSelections();
|
||||
selectionManager._update();
|
||||
|
|
Loading…
Reference in a new issue