setAngle => rotate

This commit is contained in:
Asturur 2017-08-12 13:48:01 +02:00
parent 1fd1ba3b55
commit 836bf158b9
5 changed files with 7 additions and 14 deletions

View file

@ -1032,7 +1032,7 @@
target.scaleY = 1;
target.skewX = 0;
target.skewY = 0;
target.setAngle(0);
target.rotate(0);
},
/**

View file

@ -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() {

View file

@ -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);
/**

View file

@ -1070,7 +1070,7 @@
*/
_centerObject: function(object, center) {
object.setPositionByOrigin(center, 'center', 'center');
this.requestRenderAll();
this.renderOnAddRemove && this.requestRenderAll();
return this;
},

View file

@ -557,7 +557,7 @@
target.skewY = 0;
target.flipX = false;
target.flipY = false;
target.setAngle(0);
target.rotate(0);
},
/**