Is there a method to get the untransformed bounds of an object?
For example, if I have a rectangle and it is at 10 x 10 and size is 50 x 100 I can get the bounds with:
var bounds = sceneNode.globalBounds; // {x:10, y:10, width: 50, height: 100}
Then when I change the rotation by 45’ the bounds are :-18.03 x 6.97
var bounds = sceneNode.globalBounds; // {x:10, y:10, width: 50, height: 100}
sceneNode.rotateAround(45, sceneNode.localCenterPoint);
// Update to original post: the next line has a typo in the size, corrected line after
// var bounds = sceneNode.globalBounds; // {x:-18.03, y:6.97, width: 50, height: 100}
var bounds = sceneNode.globalBounds; // {x:-18.03, y:6.97, width: 106.1, height: 106.1}
sceneNode.rotateAround(-sceneNode.rotation, sceneNode.localCenterPoint);
Is it possible to get the original unrotated bounds? When I manually rotate the scene node back it works but if it is outside of the edit context I get an error:
Plugin Error: Plugin abc is not permitted to make changes from the background. Return a Promise to continue execution asynchronously.
at convertPluginErrorToString (plugins/PluginErrorUtil.js:1:198)
at internalFormatPluginError (plugins/PluginErrorUtil.js:1:503)
at internalReportPluginError (plugins/PluginErrorUtil.js:1:610)
at Object.reportPluginError (plugins/PluginErrorUtil.js:1:1015)
at Object.checkAllowedToEdit (plugins/ScenegraphGuard.js:1:1097)
at Line.<anonymous> (plugins/ScenegraphWrappers.js:1:2399)
at exportLine (/Users/bob/Library/Application Support/Adobe/Adobe XD CC/develop/myplugin/main.js:100:8)
Is there a way to get the untransformed bounds:
var untransformedBounds = sceneNode.getUntransformedBounds();