Leaflet.Path.Transform icon indicating copy to clipboard operation
Leaflet.Path.Transform copied to clipboard

Support non-uniform scaling

Open data-ux opened this issue 7 years ago • 10 comments

It would be great if there was an option to allow non-uniform scaling. In this mode the scale handles would freely follow the mouse pointer when dragged and the feature would stretch accordingly.

data-ux avatar Mar 13 '17 12:03 data-ux

it is supported internally, https://github.com/w8r/Leaflet.Path.Transform/blob/master/src/Path.Transform.js#L620 I just never thought of a usecase for that. But it definitely could be a setting.

w8r avatar Mar 13 '17 12:03 w8r

@w8r Thanks for the quick reaction. What I was actually looking for was a non-uniform scaling option that would stretch the shape in a way that keeps the bounding rectangle as as rectangle (keep right-angle corners).

Apart from my use case, I think this kind of non-uniform scaling would be more useful than the type of stretching that is currently implemented.

data-ux avatar Mar 14 '17 08:03 data-ux

You mean skewing? That's a bit different. Also possible to implement, but I don't see a point in it. This type of stretching introduces a lot of distortion which most of the times is easier to avoid with point-by-point editing.

w8r avatar Mar 14 '17 09:03 w8r

I don't mean skewing. I think non-uniform scaling should happen in the coordinate system of the bounding rectangle. That is, if the user first rotates and then scales, the bounding rectangle should stay rectangular. In the current implementation, the bounding rectangle gets stretched out of rectangular shape.

example

Left is what I would expect happening, right is how current implementation works.

data-ux avatar Mar 14 '17 09:03 data-ux

Ok, I didn't test it properly

w8r avatar Mar 14 '17 09:03 w8r

I suppose I forgot to transform the origin point

w8r avatar Mar 14 '17 09:03 w8r

@w8r Is there a simple fix for this? (Simply transforming the origin point after rotation or something?)

talford avatar May 02 '17 23:05 talford

up

joelpanor avatar Jan 10 '18 01:01 joelpanor

@w8r Is there a simple fix for this? I have the same issue

joelpanor avatar Jan 10 '18 01:01 joelpanor

@w8r @joelpanor I face the same issue, any news ?

Mxde59 avatar Mar 19 '19 09:03 Mxde59