When scaling, the first parameter is the X scale. If you do not specify other parameters, it will use this as the Y scale and scale around the center of the object.
When you scale the rectangle, it scales around the center of the rectangle. If you want circles to also scale around this point, rather than their centers, you must specify this point.
So the last line could be set.transform("s0.5,0.5,100,100");(100,100 is the center of the rectangle that you scaled)
At least I think this is what you are asking for.
source
share