-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rectangle Scaling #39
Comments
Hi @mohammedzamakhan, same issue for me, any news ? |
Ah, ok, I think I understood what you want. |
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 : 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, |
Hi @w8r, hi everyone. |
Hi @w8r , |
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
The text was updated successfully, but these errors were encountered: