@postermywall/fabricjs-2 6.4.2-pmw-27 → 6.4.2-pmw-29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +1 -1
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +12 -3
- package/dist/index.mjs.map +1 -1
- package/dist/index.node.cjs +12 -3
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +12 -3
- package/dist/index.node.mjs.map +1 -1
- package/dist/package.json.min.mjs +1 -1
- package/dist/package.json.mjs +1 -1
- package/dist/src/shapes/Rect.d.ts +2 -0
- package/dist/src/shapes/Rect.d.ts.map +1 -1
- package/dist/src/shapes/Rect.min.mjs +1 -1
- package/dist/src/shapes/Rect.min.mjs.map +1 -1
- package/dist/src/shapes/Rect.mjs +11 -2
- package/dist/src/shapes/Rect.mjs.map +1 -1
- package/dist-extensions/src/shapes/Rect.d.ts +2 -0
- package/dist-extensions/src/shapes/Rect.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shapes/Rect.ts +49 -36
package/dist/index.js
CHANGED
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
}
|
|
429
429
|
const cache = new Cache();
|
|
430
430
|
|
|
431
|
-
var version = "6.4.2-pmw-
|
|
431
|
+
var version = "6.4.2-pmw-29";
|
|
432
432
|
|
|
433
433
|
// use this syntax so babel plugin see this import here
|
|
434
434
|
const VERSION = version;
|
|
@@ -10920,6 +10920,7 @@
|
|
|
10920
10920
|
|
|
10921
10921
|
const _excluded$c = ["left", "top", "width", "height", "visible"];
|
|
10922
10922
|
const rectDefaultValues = {
|
|
10923
|
+
uniformRoundness: false,
|
|
10923
10924
|
rx: 0,
|
|
10924
10925
|
ry: 0
|
|
10925
10926
|
};
|
|
@@ -10939,6 +10940,7 @@
|
|
|
10939
10940
|
this.setOptions(options);
|
|
10940
10941
|
this._initRxRy();
|
|
10941
10942
|
}
|
|
10943
|
+
|
|
10942
10944
|
/**
|
|
10943
10945
|
* Initializes rx/ry attributes
|
|
10944
10946
|
* @private
|
|
@@ -10966,9 +10968,16 @@
|
|
|
10966
10968
|
} = this;
|
|
10967
10969
|
const x = -w / 2;
|
|
10968
10970
|
const y = -h / 2;
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
+
let rx = this.rx ? this.rx : 0;
|
|
10972
|
+
let ry = this.ry ? this.ry : 0;
|
|
10971
10973
|
const isRounded = rx !== 0 || ry !== 0;
|
|
10974
|
+
if (this.uniformRoundness) {
|
|
10975
|
+
const scaling = this.getObjectScaling();
|
|
10976
|
+
rx = rx / scaling.x;
|
|
10977
|
+
ry = ry / scaling.y;
|
|
10978
|
+
}
|
|
10979
|
+
rx = Math.min(rx, w / 2);
|
|
10980
|
+
ry = Math.min(ry, h / 2);
|
|
10972
10981
|
ctx.beginPath();
|
|
10973
10982
|
ctx.moveTo(x + rx, y);
|
|
10974
10983
|
ctx.lineTo(x + w - rx, y);
|