mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-23 20:55:47 +00:00
setAngle => rotate
This commit is contained in:
parent
1fd1ba3b55
commit
836bf158b9
5 changed files with 7 additions and 14 deletions
|
|
@ -1032,7 +1032,7 @@
|
|||
target.scaleY = 1;
|
||||
target.skewX = 0;
|
||||
target.skewY = 0;
|
||||
target.setAngle(0);
|
||||
target.rotate(0);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
* @chainable
|
||||
*/
|
||||
straighten: function() {
|
||||
this.setAngle(this._getAngleValueForStraighten());
|
||||
this.rotate(this._getAngleValueForStraighten());
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
endValue: this._getAngleValueForStraighten(),
|
||||
duration: this.FX_DURATION,
|
||||
onChange: function(value) {
|
||||
_this.setAngle(value);
|
||||
_this.rotate(value);
|
||||
onChange();
|
||||
},
|
||||
onComplete: function() {
|
||||
|
|
|
|||
|
|
@ -1576,12 +1576,12 @@
|
|||
},
|
||||
|
||||
/**
|
||||
* Sets "angle" of an instance
|
||||
* Sets "angle" of an instance with centered rotation
|
||||
* @param {Number} angle Angle value (in degrees)
|
||||
* @return {fabric.Object} thisArg
|
||||
* @chainable
|
||||
*/
|
||||
setAngle: function(angle) {
|
||||
rotate: function(angle) {
|
||||
var shouldCenterOrigin = (this.originX !== 'center' || this.originY !== 'center') && this.centeredRotation;
|
||||
|
||||
if (shouldCenterOrigin) {
|
||||
|
|
@ -1707,13 +1707,6 @@
|
|||
|
||||
fabric.util.createAccessors && fabric.util.createAccessors(fabric.Object);
|
||||
|
||||
/**
|
||||
* Alias for {@link fabric.Object.prototype.setAngle}
|
||||
* @alias rotate -> setAngle
|
||||
* @memberOf fabric.Object
|
||||
*/
|
||||
fabric.Object.prototype.rotate = fabric.Object.prototype.setAngle;
|
||||
|
||||
extend(fabric.Object.prototype, fabric.Observable);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1070,7 +1070,7 @@
|
|||
*/
|
||||
_centerObject: function(object, center) {
|
||||
object.setPositionByOrigin(center, 'center', 'center');
|
||||
this.requestRenderAll();
|
||||
this.renderOnAddRemove && this.requestRenderAll();
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@
|
|||
target.skewY = 0;
|
||||
target.flipX = false;
|
||||
target.flipY = false;
|
||||
target.setAngle(0);
|
||||
target.rotate(0);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue