Clone clip height, width, fillcolor issues

I make a square. turn it into a clip. name it quad
then i clone it and set a new Y for the clone quad2 (all works)
if I try to set height or width (or even fill color) the clone quad2 disappear.

quad2=quad.clone();
quad2.y=200;
quad2.width=10; //quad2 disappear !!!

this is pretty strange as I can change all properties on the base quad clip
in fact this is the workaround I’m using at present (change base clip properties before cloning it)

So you want your clone to be a different width from the original? I think it would work better to use the scaleX property for that. I’m actually not sure you can set the width property that way, it might be read-only. But you could do this:
quad2.scaleX = 0.5 //this will set it to half the width of the original

Edit: I just realized setting the width for normal objects does work (I guess I never really tried it myself, oops)

Thank you for the report. Although @bluecake’s suggestion of scale should work, the width and height properties should not make an object disappear!

1 Like

you are right
quad2.scaleX=2;

scale works and I can use it as workaround
However in my project I already know the heights of the cloned clips and getting the scale factor involve a step further (let alone the approximation of the rounding)
setting directly width, height… would be preferable.

The scaleX (and Y) of a text object is always set to 1, and not being able to define its width or height really doesn’t allow me to know it size… I’ll wait for this bug to get fixed, but is there a method I can use in the meantime?

edit:
nvrmnd,
I found a way to find the width and height by finding the difference from side to side of an object

the object disappearing when setting the width/height is because it’s actually set to Infinity. when setting the width/height it divides the new number by the previous width/height to calculate the new scaleX. however, on creation, the width/height of the object are set to 0 so this would result in the new size being Infinity.