Open mohammedzamakhan opened 6 years ago
Current behavior (check after I disable uniform scaling)
Shows incorrect points for scaling and rotation
Hi @mohammedzamakhan, same issue for me, any news ?
Can you reproduce on the demo page? I can't
Uniform scaling is default behaviour, why do you need to disable it?
Ah, ok, I think I understood what you want.
What a quick response :)
Example below of what i'm looking for :
I get it. I will work on it as soon as I can (probably end of this week, beginning of the next one) but any help would be appreciated, since I am quite busy
I think this commit is a good point to start :
https://github.com/w8r/Leaflet.Path.Transform/commit/6cd2b249a5ee7e6714db8fa977ecfff974e25d4a
My research lead me to onScale method :
_onScale: function(evt) {
var originPoint = this._originMarker._point;
var ratioX, ratioY;
if (this.options.uniformScaling) {
ratioX = originPoint.distanceTo(evt.layerPoint) / this._initialDist;
ratioY = ratioX;
} else {
ratioX = (originPoint.x - evt.layerPoint.x) / this._initialDistX;
ratioY = (originPoint.y - evt.layerPoint.y) / this._initialDistY;
}
We know that with uniformScaling to true (default value) everything is OK.
But didn't suuceed to do the fix.
Thanks for help
Hi @w8r
I know that time is precious, did you succeed to spend some on it ?
Thanks.
Was this issue ever resolved?
Hi @w8r, Sorry for asking again. Didn't succeed to find a solution from my side, do you have some times to spend on it pls ? Thanks a lot.
Hi @w8r, hi everyone. Still open, if someone can help ... Thanks a lot.
Hi @w8r , Sorry for asking again, but this feature could help me a lot. Any help possible ? Thanks a lot.
This version (from #69, also see #71 and #10) only appears to work for rectangles. Originally from here, saved just in case.
I tried local polyfill for the actual version to rotate complex shapes but not succeded yet (it calculates rotation angle from handles, rotates the whole thing to zero angle, applies scale and rotates it back). I have to think about how handles work in this new coordinate system and 2x3 matrix. Also after mouseup it applies its old method back so it needs to be dealt with too.
I want to scale rectangle to different height/width ratio, along with keeping it as a rectangle, like this image shows. Currently I do not know a way of doing this