Skip to content

Commit

Permalink
Update misc.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Jan 19, 2022
1 parent 8250ea4 commit fb83a71
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/util/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@
scaleX = sqrt(denom),
scaleY = (a[0] * a[3] - a[2] * a[1]) / scaleX,
skewX = atan2(a[0] * a[2] + a[1] * a [3], denom);
return {
var options = {
angle: angle / PiBy180,
scaleX: scaleX,
scaleY: scaleY,
Expand All @@ -944,6 +944,13 @@
translateX: a[4],
translateY: a[5]
};
Object.defineProperty(options, 'matrix', {
value: a,
configurable: false,
enumerable: false,
writable: false
});
return options;
},

/**
Expand Down Expand Up @@ -1028,7 +1035,10 @@
* @param {Number} [options.translateY]
* @return {Number[]} transform matrix
*/
composeMatrix: function(options) {
composeMatrix: function (options) {
if (options.matrix) {
return options.matrix;
}
var matrix = [1, 0, 0, 1, options.translateX || 0, options.translateY || 0],
multiply = fabric.util.multiplyTransformMatrices;
if (options.angle) {
Expand Down

0 comments on commit fb83a71

Please sign in to comment.