mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 13:27:33 +08:00
support for rad in resizer
This commit is contained in:
parent
64cf5a9a95
commit
310004337d
11
konva.js
11
konva.js
@ -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
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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)) +
|
||||
|
Loading…
Reference in New Issue
Block a user