mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-21 20:01:52 +00:00
Merge pull request #2277 from sapics/notchange-feature-fix
character correction
This commit is contained in:
commit
ead7d40a4c
5 changed files with 18 additions and 20 deletions
|
|
@ -288,7 +288,7 @@
|
|||
/**
|
||||
* Returns {@link fabric.Gradient} instance from an SVG element
|
||||
* @static
|
||||
* @memberof fabric.Gradient
|
||||
* @memberOf fabric.Gradient
|
||||
* @param {SVGGradientElement} el SVG gradient element
|
||||
* @param {fabric.Object} instance
|
||||
* @return {fabric.Gradient} Gradient instance
|
||||
|
|
@ -368,7 +368,7 @@
|
|||
/**
|
||||
* Returns {@link fabric.Gradient} instance from its object representation
|
||||
* @static
|
||||
* @memberof fabric.Gradient
|
||||
* @memberOf fabric.Gradient
|
||||
* @param {Object} obj
|
||||
* @param {Object} [options] Options object
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -914,7 +914,7 @@
|
|||
|
||||
/**
|
||||
* Takes url corresponding to an SVG document, and parses it into a set of fabric objects. Note that SVG is fetched via XMLHttpRequest, so it needs to conform to SOP (Same Origin Policy)
|
||||
* @memberof fabric
|
||||
* @memberOf fabric
|
||||
* @param {String} url
|
||||
* @param {Function} callback
|
||||
* @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created.
|
||||
|
|
@ -962,7 +962,7 @@
|
|||
|
||||
/**
|
||||
* Takes string corresponding to an SVG document, and parses it into a set of fabric objects
|
||||
* @memberof fabric
|
||||
* @memberOf fabric
|
||||
* @param {String} string
|
||||
* @param {Function} callback
|
||||
* @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created.
|
||||
|
|
|
|||
|
|
@ -469,12 +469,14 @@
|
|||
var aX = [],
|
||||
aY = [],
|
||||
o, prop,
|
||||
props = ['tr', 'br', 'bl', 'tl'];
|
||||
props = ['tr', 'br', 'bl', 'tl'],
|
||||
i = 0, iLen = this._objects.length,
|
||||
j, jLen = props.length;
|
||||
|
||||
for (var i = 0, len = this._objects.length; i < len; ++i) {
|
||||
for ( ; i < iLen; ++i) {
|
||||
o = this._objects[i];
|
||||
o.setCoords();
|
||||
for (var j = 0; j < props.length; j++) {
|
||||
for (j = 0; j < jLen; j++) {
|
||||
prop = props[j];
|
||||
aX.push(o.oCoords[prop].x);
|
||||
aY.push(o.oCoords[prop].y);
|
||||
|
|
|
|||
|
|
@ -1493,7 +1493,7 @@
|
|||
/**
|
||||
* Alias for {@link fabric.Object.prototype.setAngle}
|
||||
* @alias rotate -> setAngle
|
||||
* @memberof fabric.Object
|
||||
* @memberOf fabric.Object
|
||||
*/
|
||||
fabric.Object.prototype.rotate = fabric.Object.prototype.setAngle;
|
||||
|
||||
|
|
@ -1503,7 +1503,7 @@
|
|||
* Defines the number of fraction digits to use when serializing object values.
|
||||
* You can use it to increase/decrease precision of such values like left, top, scaleX, scaleY, etc.
|
||||
* @static
|
||||
* @memberof fabric.Object
|
||||
* @memberOf fabric.Object
|
||||
* @constant
|
||||
* @type Number
|
||||
*/
|
||||
|
|
@ -1512,7 +1512,7 @@
|
|||
/**
|
||||
* Unique id used internally when creating SVG elements
|
||||
* @static
|
||||
* @memberof fabric.Object
|
||||
* @memberOf fabric.Object
|
||||
* @type Number
|
||||
*/
|
||||
fabric.Object.__uid = 0;
|
||||
|
|
|
|||
|
|
@ -70,14 +70,11 @@
|
|||
* @return {fabric.Point} The new rotated point
|
||||
*/
|
||||
rotatePoint: function(point, origin, radians) {
|
||||
var sin = Math.sin(radians),
|
||||
cos = Math.cos(radians);
|
||||
|
||||
point.subtractEquals(origin);
|
||||
|
||||
var rx = point.x * cos - point.y * sin,
|
||||
var sin = Math.sin(radians),
|
||||
cos = Math.cos(radians),
|
||||
rx = point.x * cos - point.y * sin,
|
||||
ry = point.x * sin + point.y * cos;
|
||||
|
||||
return new fabric.Point(rx, ry).addEquals(origin);
|
||||
},
|
||||
|
||||
|
|
@ -111,10 +108,9 @@
|
|||
* @return {Array} The inverted transform
|
||||
*/
|
||||
invertTransform: function(t) {
|
||||
var r = t.slice(),
|
||||
a = 1 / (t[0] * t[3] - t[1] * t[2]);
|
||||
r = [a * t[3], -a * t[1], -a * t[2], a * t[0], 0, 0];
|
||||
var o = fabric.util.transformPoint({ x: t[4], y: t[5] }, r);
|
||||
var a = 1 / (t[0] * t[3] - t[1] * t[2]),
|
||||
r = [a * t[3], -a * t[1], -a * t[2], a * t[0]],
|
||||
o = fabric.util.transformPoint({ x: t[4], y: t[5] }, r, true);
|
||||
r[4] = -o.x;
|
||||
r[5] = -o.y;
|
||||
return r;
|
||||
|
|
|
|||
Loading…
Reference in a new issue