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/CHANGELOG.md +5 -1
- package/dist/index.js +10 -4
- 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 +10 -4
- package/dist/index.mjs.map +1 -1
- package/dist/index.node.cjs +10 -4
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +10 -4
- 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/controls/changeWidth.d.ts.map +1 -1
- package/dist/src/controls/changeWidth.min.mjs +1 -1
- package/dist/src/controls/changeWidth.min.mjs.map +1 -1
- package/dist/src/controls/changeWidth.mjs +2 -2
- package/dist/src/controls/changeWidth.mjs.map +1 -1
- package/dist/src/shapes/Text/Text.d.ts +4 -0
- package/dist/src/shapes/Text/Text.d.ts.map +1 -1
- package/dist/src/shapes/Text/Text.min.mjs +1 -1
- package/dist/src/shapes/Text/Text.min.mjs.map +1 -1
- package/dist/src/shapes/Text/Text.mjs +7 -1
- package/dist/src/shapes/Text/Text.mjs.map +1 -1
- package/dist-extensions/src/controls/changeWidth.d.ts.map +1 -1
- package/dist-extensions/src/shapes/Text/Text.d.ts +4 -0
- package/dist-extensions/src/shapes/Text/Text.d.ts.map +1 -1
- package/package.json +1 -3
- package/rollup.config.mjs +2 -1
- package/src/controls/changeWidth.test.ts +9 -0
- package/src/controls/changeWidth.ts +3 -4
- package/src/shapes/Text/Text.ts +14 -2
package/dist/index.node.mjs
CHANGED
|
@@ -461,7 +461,7 @@ class Cache {
|
|
|
461
461
|
}
|
|
462
462
|
const cache = new Cache();
|
|
463
463
|
|
|
464
|
-
var version = "6.4.
|
|
464
|
+
var version = "6.4.3";
|
|
465
465
|
|
|
466
466
|
// use this syntax so babel plugin see this import here
|
|
467
467
|
const VERSION = version;
|
|
@@ -8283,8 +8283,8 @@ const changeObjectWidth = (eventData, transform, x, y) => {
|
|
|
8283
8283
|
strokePadding = target.strokeWidth / (target.strokeUniform ? target.scaleX : 1),
|
|
8284
8284
|
multiplier = isTransformCentered(transform) ? 2 : 1,
|
|
8285
8285
|
oldWidth = target.width,
|
|
8286
|
-
newWidth = Math.
|
|
8287
|
-
target.set('width', Math.max(newWidth,
|
|
8286
|
+
newWidth = Math.abs(localPoint.x * multiplier / target.scaleX) - strokePadding;
|
|
8287
|
+
target.set('width', Math.max(newWidth, 1));
|
|
8288
8288
|
// check against actual target width in case `newWidth` was rejected
|
|
8289
8289
|
return oldWidth !== target.width;
|
|
8290
8290
|
}
|
|
@@ -20088,6 +20088,12 @@ class FabricText extends StyledText {
|
|
|
20088
20088
|
complexity() {
|
|
20089
20089
|
return 1;
|
|
20090
20090
|
}
|
|
20091
|
+
|
|
20092
|
+
/**
|
|
20093
|
+
* List of generic font families
|
|
20094
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
|
|
20095
|
+
*/
|
|
20096
|
+
|
|
20091
20097
|
/**
|
|
20092
20098
|
* Returns FabricText instance from an SVG element (<b>not yet implemented</b>)
|
|
20093
20099
|
* @static
|
|
@@ -20172,7 +20178,7 @@ _defineProperty(FabricText, "textLayoutProperties", textLayoutProperties);
|
|
|
20172
20178
|
_defineProperty(FabricText, "cacheProperties", [...cacheProperties, ...additionalProps]);
|
|
20173
20179
|
_defineProperty(FabricText, "ownDefaults", textDefaultValues);
|
|
20174
20180
|
_defineProperty(FabricText, "type", 'Text');
|
|
20175
|
-
_defineProperty(FabricText, "genericFonts", ['sans-serif', '
|
|
20181
|
+
_defineProperty(FabricText, "genericFonts", ['serif', 'sans-serif', 'monospace', 'cursive', 'fantasy', 'system-ui', 'ui-serif', 'ui-sans-serif', 'ui-monospace', 'ui-rounded', 'math', 'emoji', 'fangsong']);
|
|
20176
20182
|
/* _FROM_SVG_START_ */
|
|
20177
20183
|
/**
|
|
20178
20184
|
* List of attribute names to account for when parsing SVG element (used by {@link FabricText.fromElement})
|