Copy link to clipboard
Copied
Hello,
I want to change the height of an object:
// Transfomation.Center = true;
selectedNewObjects[0].height = vHeight; // Reset the height
but the orgin should be the center of the object.
I found the constant "Transfomation.Center". But how can I set it before I change the height?
– Jens.
1 Correct answer
You could use resize(), which uses percentages of present width and height and for which I think Transformation is CENTER by default. So, to double your height:
selectedNewObjects[0].resize(100, 200);
If you want to use a new height, you'll have to convert it to a percentage of the present height.
Explore related tutorials & articles
Copy link to clipboard
Copied
You could use resize(), which uses percentages of present width and height and for which I think Transformation is CENTER by default. So, to double your height:
selectedNewObjects[0].resize(100, 200);
If you want to use a new height, you'll have to convert it to a percentage of the present height.
Copy link to clipboard
Copied
Thanks, that will do it. 🙂
var vScaleY = 100 - (((selectedNewObjects[0].height - vHeight) / vHeight) * 100);
selectedNewObjects[0].resize(100,vScaleY);
– Jens

