fabric 6.4.2 → 6.4.3

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.mjs CHANGED
@@ -405,7 +405,7 @@ class Cache {
405
405
  }
406
406
  const cache = new Cache();
407
407
 
408
- var version = "6.4.2";
408
+ var version = "6.4.3";
409
409
 
410
410
  // use this syntax so babel plugin see this import here
411
411
  const VERSION = version;
@@ -8227,8 +8227,8 @@ const changeObjectWidth = (eventData, transform, x, y) => {
8227
8227
  strokePadding = target.strokeWidth / (target.strokeUniform ? target.scaleX : 1),
8228
8228
  multiplier = isTransformCentered(transform) ? 2 : 1,
8229
8229
  oldWidth = target.width,
8230
- newWidth = Math.ceil(Math.abs(localPoint.x * multiplier / target.scaleX) - strokePadding);
8231
- target.set('width', Math.max(newWidth, 0));
8230
+ newWidth = Math.abs(localPoint.x * multiplier / target.scaleX) - strokePadding;
8231
+ target.set('width', Math.max(newWidth, 1));
8232
8232
  // check against actual target width in case `newWidth` was rejected
8233
8233
  return oldWidth !== target.width;
8234
8234
  }
@@ -20032,6 +20032,12 @@ class FabricText extends StyledText {
20032
20032
  complexity() {
20033
20033
  return 1;
20034
20034
  }
20035
+
20036
+ /**
20037
+ * List of generic font families
20038
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
20039
+ */
20040
+
20035
20041
  /**
20036
20042
  * Returns FabricText instance from an SVG element (<b>not yet implemented</b>)
20037
20043
  * @static
@@ -20116,7 +20122,7 @@ _defineProperty(FabricText, "textLayoutProperties", textLayoutProperties);
20116
20122
  _defineProperty(FabricText, "cacheProperties", [...cacheProperties, ...additionalProps]);
20117
20123
  _defineProperty(FabricText, "ownDefaults", textDefaultValues);
20118
20124
  _defineProperty(FabricText, "type", 'Text');
20119
- _defineProperty(FabricText, "genericFonts", ['sans-serif', 'serif', 'cursive', 'fantasy', 'monospace']);
20125
+ _defineProperty(FabricText, "genericFonts", ['serif', 'sans-serif', 'monospace', 'cursive', 'fantasy', 'system-ui', 'ui-serif', 'ui-sans-serif', 'ui-monospace', 'ui-rounded', 'math', 'emoji', 'fangsong']);
20120
20126
  /* _FROM_SVG_START_ */
20121
20127
  /**
20122
20128
  * List of attribute names to account for when parsing SVG element (used by {@link FabricText.fromElement})