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.mjs
CHANGED
|
@@ -405,7 +405,7 @@ class Cache {
|
|
|
405
405
|
}
|
|
406
406
|
const cache = new Cache();
|
|
407
407
|
|
|
408
|
-
var version = "6.4.
|
|
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.
|
|
8231
|
-
target.set('width', Math.max(newWidth,
|
|
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', '
|
|
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})
|