@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 CHANGED
@@ -428,7 +428,7 @@
428
428
  }
429
429
  const cache = new Cache();
430
430
 
431
- var version = "6.4.2-pmw-27";
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
- const rx = this.rx ? Math.min(this.rx, w / 2) : 0;
10970
- const ry = this.ry ? Math.min(this.ry, h / 2) : 0;
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);