Leaflet.Path.Transform
Leaflet.Path.Transform copied to clipboard
Support non-uniform scaling
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.
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 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.
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.
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.
Left is what I would expect happening, right is how current implementation works.
Ok, I didn't test it properly
I suppose I forgot to transform the origin point
@w8r Is there a simple fix for this? (Simply transforming the origin point after rotation or something?)
up
@w8r Is there a simple fix for this? I have the same issue
@w8r @joelpanor I face the same issue, any news ?