spakin / SimpInkScr

Simple Inkscape Scripting
https://inkscape.org/~pakin/%E2%98%85simple-inkscape-scripting
GNU General Public License v3.0
321 stars 32 forks source link

Add "anchor" argument to scale method #34

Closed OpenFoam-User closed 2 years ago

OpenFoam-User commented 2 years ago

Similarly to the rotate method : rotate(angle, anchor, first) , the scale(factor, first) method should also accept an anchor.

Why:

Because if the scale is applied on the object multiple times, the object is moving and that's not necessarily the desired behaviour. So basically, scale should add anchor argument so the user could specify the center of the object to be used.

Steps to reproduce the reported bahaviour:

for obj in objs: obj = inkex_object(obj) obj.scale(1.2)



When you keep pressing "Apply" button, the objects get scaled but move also.

![record](https://user-images.githubusercontent.com/67183566/149654781-f552701f-bf33-411a-b48b-95b55d5a71db.gif)
spakin commented 2 years ago

Similarly to the rotate method : rotate(angle, anchor, first) , the scale(factor, first) method should also accept an anchor.

That's a bit trickier than rotate because inkex doesn't support anchors for add_scale like it does for add_rotate, but I'll see what I can do…

spakin commented 2 years ago

Done. Please test.

OpenFoam-User commented 2 years ago

I have tested it and it seems to work perfectly! Many thanks

OpenFoam-User commented 2 years ago

Both rotate and scale don't work as expected for stars/polygons, text, and spirals: https://github.com/spakin/SimpInkScr/issues/35