support for rad in resizer

This commit is contained in:
Anton Lavrenov 2017-12-21 10:34:29 +07:00
parent 64cf5a9a95
commit 310004337d
3 changed files with 18 additions and 8 deletions

View File

@ -18395,14 +18395,19 @@
var dAlpha = Math.atan2(-y, x) + Math.PI / 2;
var attrs = this._getAttrs();
var newRotation = this.rotation() + dAlpha / Math.PI * 180;
var rot = Konva.getAngle(this.rotation());
var alpha = Konva.Util._degToRad(this._el.rotation());
var newRotation =
Konva.Util._radToDeg(rot) + Konva.Util._radToDeg(dAlpha);
var alpha = Konva.getAngle(this._el.rotation());
var newAlpha = Konva.Util._degToRad(newRotation);
this._setElementAttrs(
Object.assign(attrs, {
rotation: newRotation,
rotation: Konva.angleDeg
? newRotation
: Konva.Util._degToRad(newRotation),
x:
attrs.x +
attrs.width / 2 * (Math.cos(alpha) - Math.cos(newAlpha)) +

4
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -174,14 +174,19 @@
var dAlpha = Math.atan2(-y, x) + Math.PI / 2;
var attrs = this._getAttrs();
var newRotation = this.rotation() + dAlpha / Math.PI * 180;
var rot = Konva.getAngle(this.rotation());
var alpha = Konva.Util._degToRad(this._el.rotation());
var newRotation =
Konva.Util._radToDeg(rot) + Konva.Util._radToDeg(dAlpha);
var alpha = Konva.getAngle(this._el.rotation());
var newAlpha = Konva.Util._degToRad(newRotation);
this._setElementAttrs(
Object.assign(attrs, {
rotation: newRotation,
rotation: Konva.angleDeg
? newRotation
: Konva.Util._degToRad(newRotation),
x:
attrs.x +
attrs.width / 2 * (Math.cos(alpha) - Math.cos(newAlpha)) +