fabric 7.3.1 → 7.4.0
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 +40 -27
- package/dist/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/defineProperty.mjs +1 -1
- package/{dist-extensions/_virtual/_@oxc-project_runtime@0.122.0 → dist/_virtual/_@oxc-project_runtime@0.126.0}/helpers/toPrimitive.mjs +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/toPropertyKey.mjs +1 -1
- package/{dist-extensions/_virtual/_@oxc-project_runtime@0.122.0 → dist/_virtual/_@oxc-project_runtime@0.126.0}/helpers/typeof.mjs +1 -1
- package/dist/index.js +88 -66
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +35 -35
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +37 -37
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +88 -66
- package/dist/index.mjs.map +1 -1
- package/dist/index.node.cjs +83 -62
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +83 -62
- package/dist/index.node.mjs.map +1 -1
- package/dist/package.min.mjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/src/Collection.min.mjs +1 -1
- package/dist/src/Collection.mjs +1 -1
- package/dist/src/LayoutManager/LayoutManager.min.mjs +1 -1
- package/dist/src/LayoutManager/LayoutManager.mjs +1 -1
- package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.min.mjs +1 -1
- package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.mjs +1 -1
- package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.min.mjs +1 -1
- package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.mjs +1 -1
- package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.min.mjs +1 -1
- package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.mjs +1 -1
- package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.min.mjs +1 -1
- package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.mjs +1 -1
- package/dist/src/Observable.min.mjs +1 -1
- package/dist/src/Observable.mjs +1 -1
- package/dist/src/Pattern/Pattern.min.mjs +1 -1
- package/dist/src/Pattern/Pattern.mjs +1 -1
- package/dist/src/Shadow.min.mjs +1 -1
- package/dist/src/Shadow.mjs +1 -1
- package/dist/src/brushes/BaseBrush.min.mjs +1 -1
- package/dist/src/brushes/BaseBrush.mjs +1 -1
- package/dist/src/brushes/CircleBrush.min.mjs +1 -1
- package/dist/src/brushes/CircleBrush.mjs +1 -1
- package/dist/src/brushes/PencilBrush.min.mjs +1 -1
- package/dist/src/brushes/PencilBrush.mjs +1 -1
- package/dist/src/brushes/SprayBrush.min.mjs +1 -1
- package/dist/src/brushes/SprayBrush.mjs +1 -1
- package/dist/src/cache.min.mjs +1 -1
- package/dist/src/cache.mjs +1 -1
- package/dist/src/canvas/Canvas.min.mjs +1 -1
- package/dist/src/canvas/Canvas.mjs +1 -1
- package/dist/src/canvas/DOMManagers/CanvasDOMManager.min.mjs +1 -1
- package/dist/src/canvas/DOMManagers/CanvasDOMManager.mjs +1 -1
- package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.min.mjs +1 -1
- package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.mjs +1 -1
- package/dist/src/canvas/SelectableCanvas.min.mjs +1 -1
- package/dist/src/canvas/SelectableCanvas.mjs +1 -1
- package/dist/src/canvas/StaticCanvas.d.ts +1 -1
- package/dist/src/canvas/StaticCanvas.d.ts.map +1 -1
- package/dist/src/canvas/StaticCanvas.min.mjs +5 -5
- package/dist/src/canvas/StaticCanvas.min.mjs.map +1 -1
- package/dist/src/canvas/StaticCanvas.mjs +4 -4
- package/dist/src/canvas/StaticCanvas.mjs.map +1 -1
- package/dist/src/canvas/TextEditingManager.min.mjs +1 -1
- package/dist/src/canvas/TextEditingManager.mjs +1 -1
- package/dist/src/color/Color.min.mjs +1 -1
- package/dist/src/color/Color.mjs +1 -1
- package/dist/src/config.min.mjs +1 -1
- package/dist/src/config.mjs +1 -1
- package/dist/src/controls/Control.min.mjs +1 -1
- package/dist/src/controls/Control.mjs +1 -1
- package/dist/src/filters/BaseFilter.min.mjs +1 -1
- package/dist/src/filters/BaseFilter.mjs +1 -1
- package/dist/src/filters/BlendColor.min.mjs +1 -1
- package/dist/src/filters/BlendColor.mjs +1 -1
- package/dist/src/filters/BlendImage.min.mjs +1 -1
- package/dist/src/filters/BlendImage.mjs +1 -1
- package/dist/src/filters/Blur.min.mjs +1 -1
- package/dist/src/filters/Blur.mjs +1 -1
- package/dist/src/filters/Brightness.min.mjs +1 -1
- package/dist/src/filters/Brightness.mjs +1 -1
- package/dist/src/filters/Canvas2dFilterBackend.min.mjs +1 -1
- package/dist/src/filters/Canvas2dFilterBackend.mjs +1 -1
- package/dist/src/filters/ColorMatrix.min.mjs +1 -1
- package/dist/src/filters/ColorMatrix.mjs +1 -1
- package/dist/src/filters/ColorMatrixFilters.min.mjs +1 -1
- package/dist/src/filters/ColorMatrixFilters.mjs +1 -1
- package/dist/src/filters/Composed.min.mjs +1 -1
- package/dist/src/filters/Composed.mjs +1 -1
- package/dist/src/filters/Contrast.min.mjs +1 -1
- package/dist/src/filters/Contrast.mjs +1 -1
- package/dist/src/filters/Convolute.min.mjs +1 -1
- package/dist/src/filters/Convolute.min.mjs.map +1 -1
- package/dist/src/filters/Convolute.mjs +1 -1
- package/dist/src/filters/Gamma.min.mjs +1 -1
- package/dist/src/filters/Gamma.mjs +1 -1
- package/dist/src/filters/Grayscale.min.mjs +1 -1
- package/dist/src/filters/Grayscale.mjs +1 -1
- package/dist/src/filters/HueRotation.min.mjs +1 -1
- package/dist/src/filters/HueRotation.mjs +1 -1
- package/dist/src/filters/Invert.min.mjs +1 -1
- package/dist/src/filters/Invert.mjs +1 -1
- package/dist/src/filters/Noise.min.mjs +1 -1
- package/dist/src/filters/Noise.mjs +1 -1
- package/dist/src/filters/Pixelate.min.mjs +1 -1
- package/dist/src/filters/Pixelate.mjs +1 -1
- package/dist/src/filters/RemoveColor.min.mjs +1 -1
- package/dist/src/filters/RemoveColor.mjs +1 -1
- package/dist/src/filters/Resize.min.mjs +2 -2
- package/dist/src/filters/Resize.min.mjs.map +1 -1
- package/dist/src/filters/Resize.mjs +2 -2
- package/dist/src/filters/Resize.mjs.map +1 -1
- package/dist/src/filters/Saturation.min.mjs +1 -1
- package/dist/src/filters/Saturation.mjs +1 -1
- package/dist/src/filters/Vibrance.min.mjs +1 -1
- package/dist/src/filters/Vibrance.mjs +1 -1
- package/dist/src/filters/WebGLFilterBackend.min.mjs +1 -1
- package/dist/src/filters/WebGLFilterBackend.mjs +1 -1
- package/dist/src/gradient/Gradient.d.ts.map +1 -1
- package/dist/src/gradient/Gradient.min.mjs +4 -4
- package/dist/src/gradient/Gradient.min.mjs.map +1 -1
- package/dist/src/gradient/Gradient.mjs +6 -2
- package/dist/src/gradient/Gradient.mjs.map +1 -1
- package/dist/src/gradient/typedefs.d.ts +7 -7
- package/dist/src/parser/applyViewboxTransform.d.ts.map +1 -1
- package/dist/src/parser/applyViewboxTransform.min.mjs +1 -1
- package/dist/src/parser/applyViewboxTransform.min.mjs.map +1 -1
- package/dist/src/parser/applyViewboxTransform.mjs +2 -4
- package/dist/src/parser/applyViewboxTransform.mjs.map +1 -1
- package/dist/src/shapes/ActiveSelection.min.mjs +1 -1
- package/dist/src/shapes/ActiveSelection.mjs +1 -1
- package/dist/src/shapes/Circle.min.mjs +2 -2
- package/dist/src/shapes/Circle.min.mjs.map +1 -1
- package/dist/src/shapes/Circle.mjs +1 -1
- package/dist/src/shapes/Ellipse.min.mjs +1 -1
- package/dist/src/shapes/Ellipse.mjs +1 -1
- package/dist/src/shapes/Group.min.mjs +1 -1
- package/dist/src/shapes/Group.mjs +1 -1
- package/dist/src/shapes/IText/DraggableTextDelegate.min.mjs +1 -1
- package/dist/src/shapes/IText/DraggableTextDelegate.mjs +1 -1
- package/dist/src/shapes/IText/IText.d.ts.map +1 -1
- package/dist/src/shapes/IText/IText.min.mjs +1 -1
- package/dist/src/shapes/IText/IText.min.mjs.map +1 -1
- package/dist/src/shapes/IText/IText.mjs +3 -3
- package/dist/src/shapes/IText/IText.mjs.map +1 -1
- package/dist/src/shapes/IText/ITextBehavior.min.mjs +1 -1
- package/dist/src/shapes/IText/ITextBehavior.mjs +1 -1
- package/dist/src/shapes/IText/ITextClickBehavior.min.mjs +1 -1
- package/dist/src/shapes/IText/ITextClickBehavior.mjs +1 -1
- package/dist/src/shapes/Image.min.mjs +1 -1
- package/dist/src/shapes/Image.mjs +1 -1
- package/dist/src/shapes/Line.min.mjs +1 -1
- package/dist/src/shapes/Line.mjs +1 -1
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts.map +1 -1
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.min.mjs +2 -2
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.min.mjs.map +1 -1
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.mjs +11 -26
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.mjs.map +1 -1
- package/dist/src/shapes/Object/InteractiveObject.d.ts.map +1 -1
- package/dist/src/shapes/Object/InteractiveObject.min.mjs +1 -1
- package/dist/src/shapes/Object/InteractiveObject.min.mjs.map +1 -1
- package/dist/src/shapes/Object/InteractiveObject.mjs +7 -6
- package/dist/src/shapes/Object/InteractiveObject.mjs.map +1 -1
- package/dist/src/shapes/Object/Object.min.mjs +1 -1
- package/dist/src/shapes/Object/Object.mjs +1 -1
- package/dist/src/shapes/Object/ObjectGeometry.d.ts.map +1 -1
- package/dist/src/shapes/Object/ObjectGeometry.min.mjs +1 -1
- package/dist/src/shapes/Object/ObjectGeometry.min.mjs.map +1 -1
- package/dist/src/shapes/Object/ObjectGeometry.mjs +6 -2
- package/dist/src/shapes/Object/ObjectGeometry.mjs.map +1 -1
- package/dist/src/shapes/Object/types/FabricObjectProps.d.ts +1 -1
- package/dist/src/shapes/Path.min.mjs +1 -1
- package/dist/src/shapes/Path.mjs +1 -1
- package/dist/src/shapes/Polygon.min.mjs +1 -1
- package/dist/src/shapes/Polygon.mjs +1 -1
- package/dist/src/shapes/Polyline.min.mjs +1 -1
- package/dist/src/shapes/Polyline.mjs +1 -1
- package/dist/src/shapes/Rect.min.mjs +1 -1
- package/dist/src/shapes/Rect.mjs +1 -1
- package/dist/src/shapes/Text/StyledText.min.mjs +1 -1
- package/dist/src/shapes/Text/StyledText.mjs +1 -1
- package/dist/src/shapes/Text/Text.d.ts +4 -4
- 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 +3 -3
- package/dist/src/shapes/Text/Text.mjs.map +1 -1
- package/dist/src/shapes/Text/TextSVGExportMixin.d.ts.map +1 -1
- package/dist/src/shapes/Text/TextSVGExportMixin.min.mjs +2 -2
- package/dist/src/shapes/Text/TextSVGExportMixin.min.mjs.map +1 -1
- package/dist/src/shapes/Text/TextSVGExportMixin.mjs +14 -7
- package/dist/src/shapes/Text/TextSVGExportMixin.mjs.map +1 -1
- package/dist/src/shapes/Textbox.d.ts.map +1 -1
- package/dist/src/shapes/Textbox.min.mjs +2 -2
- package/dist/src/shapes/Textbox.min.mjs.map +1 -1
- package/dist/src/shapes/Textbox.mjs +2 -3
- package/dist/src/shapes/Textbox.mjs.map +1 -1
- package/dist/src/shapes/Triangle.min.mjs +1 -1
- package/dist/src/shapes/Triangle.mjs +1 -1
- package/dist/src/util/animation/AnimationBase.min.mjs +1 -1
- package/dist/src/util/animation/AnimationBase.mjs +1 -1
- package/dist/src/util/animation/easing.min.mjs +1 -1
- package/dist/src/util/animation/easing.min.mjs.map +1 -1
- package/dist/src/util/animation/easing.mjs +1 -1
- package/dist/src/util/animation/easing.mjs.map +1 -1
- package/dist/src/util/internals/applyCanvasTransform.d.ts +1 -1
- package/dist/src/util/internals/applyCanvasTransform.min.mjs.map +1 -1
- package/dist/src/util/internals/applyCanvasTransform.mjs +1 -1
- package/dist/src/util/internals/applyCanvasTransform.mjs.map +1 -1
- package/dist/src/util/internals/svgExportCheck.d.ts +4 -0
- package/dist/src/util/internals/svgExportCheck.d.ts.map +1 -0
- package/dist/src/util/internals/svgExportCheck.min.mjs +2 -0
- package/dist/src/util/internals/svgExportCheck.min.mjs.map +1 -0
- package/dist/src/util/internals/svgExportCheck.mjs +12 -0
- package/dist/src/util/internals/svgExportCheck.mjs.map +1 -0
- package/dist/src/util/misc/matrix.d.ts +14 -0
- package/dist/src/util/misc/matrix.d.ts.map +1 -1
- package/dist/src/util/misc/matrix.min.mjs +1 -1
- package/dist/src/util/misc/matrix.min.mjs.map +1 -1
- package/dist/src/util/misc/matrix.mjs +15 -1
- package/dist/src/util/misc/matrix.mjs.map +1 -1
- package/dist/src/util/misc/mergeClipPaths.d.ts +1 -1
- package/dist/src/util/misc/mergeClipPaths.min.mjs.map +1 -1
- package/dist/src/util/misc/mergeClipPaths.mjs +1 -1
- package/dist/src/util/misc/mergeClipPaths.mjs.map +1 -1
- package/dist/src/util/misc/objectEnlive.min.mjs.map +1 -1
- package/dist/src/util/misc/objectEnlive.mjs +1 -1
- package/dist/src/util/misc/objectEnlive.mjs.map +1 -1
- package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.min.mjs +1 -1
- package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.min.mjs.map +1 -1
- package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.mjs +1 -1
- package/dist/src/util/misc/svgParsing.d.ts +2 -2
- package/dist/src/util/misc/svgParsing.d.ts.map +1 -1
- package/dist/src/util/misc/svgParsing.min.mjs +1 -1
- package/dist/src/util/misc/svgParsing.min.mjs.map +1 -1
- package/dist/src/util/misc/svgParsing.mjs +8 -3
- package/dist/src/util/misc/svgParsing.mjs.map +1 -1
- package/dist/src/util/path/index.d.ts.map +1 -1
- package/dist/src/util/path/index.min.mjs +1 -1
- package/dist/src/util/path/index.min.mjs.map +1 -1
- package/dist/src/util/path/index.mjs +2 -1
- package/dist/src/util/path/index.mjs.map +1 -1
- package/dist/src/util/path/regex.min.mjs.map +1 -1
- package/dist/src/util/path/regex.mjs +1 -1
- package/dist/src/util/path/regex.mjs.map +1 -1
- package/dist-extensions/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/defineProperty.mjs +1 -1
- package/{dist/_virtual/_@oxc-project_runtime@0.122.0 → dist-extensions/_virtual/_@oxc-project_runtime@0.126.0}/helpers/toPrimitive.mjs +1 -1
- package/dist-extensions/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/toPropertyKey.mjs +1 -1
- package/{dist/_virtual/_@oxc-project_runtime@0.122.0 → dist-extensions/_virtual/_@oxc-project_runtime@0.126.0}/helpers/typeof.mjs +1 -1
- package/dist-extensions/aligning_guidelines/index.mjs +1 -1
- package/dist-extensions/cropping_controls/croppingHandlers.mjs +1 -7
- package/dist-extensions/cropping_controls/croppingHandlers.mjs.map +1 -1
- package/dist-extensions/extensions/cropping_controls/croppingHandlers.d.ts.map +1 -1
- package/dist-extensions/fabric-extensions.min.js +1 -1
- package/dist-extensions/fabric-extensions.min.js.map +1 -1
- package/dist-extensions/src/canvas/StaticCanvas.d.ts +1 -1
- package/dist-extensions/src/canvas/StaticCanvas.d.ts.map +1 -1
- package/dist-extensions/src/gradient/Gradient.d.ts.map +1 -1
- package/dist-extensions/src/gradient/typedefs.d.ts +7 -7
- package/dist-extensions/src/parser/applyViewboxTransform.d.ts.map +1 -1
- package/dist-extensions/src/shapes/IText/IText.d.ts.map +1 -1
- package/dist-extensions/src/shapes/Object/FabricObjectSVGExportMixin.d.ts.map +1 -1
- package/dist-extensions/src/shapes/Object/InteractiveObject.d.ts.map +1 -1
- package/dist-extensions/src/shapes/Object/ObjectGeometry.d.ts.map +1 -1
- package/dist-extensions/src/shapes/Object/types/FabricObjectProps.d.ts +1 -1
- package/dist-extensions/src/shapes/Text/Text.d.ts +4 -4
- package/dist-extensions/src/shapes/Text/TextSVGExportMixin.d.ts.map +1 -1
- package/dist-extensions/src/shapes/Textbox.d.ts.map +1 -1
- package/dist-extensions/src/util/internals/applyCanvasTransform.d.ts +1 -1
- package/dist-extensions/src/util/internals/svgExportCheck.d.ts +4 -0
- package/dist-extensions/src/util/internals/svgExportCheck.d.ts.map +1 -0
- package/dist-extensions/src/util/misc/matrix.d.ts +14 -0
- package/dist-extensions/src/util/misc/matrix.d.ts.map +1 -1
- package/dist-extensions/src/util/misc/mergeClipPaths.d.ts +1 -1
- package/dist-extensions/src/util/misc/svgParsing.d.ts +2 -2
- package/dist-extensions/src/util/misc/svgParsing.d.ts.map +1 -1
- package/dist-extensions/src/util/path/index.d.ts.map +1 -1
- package/extensions/cropping_controls/croppingHandlers.ts +13 -19
- package/package.json +10 -10
- package/src/LayoutManager/README.md +3 -3
- package/src/canvas/StaticCanvas.spec.ts +19 -0
- package/src/canvas/StaticCanvas.ts +7 -3
- package/src/filters/Resize.ts +1 -1
- package/src/gradient/Gradient.spec.ts +60 -1
- package/src/gradient/Gradient.ts +9 -2
- package/src/gradient/typedefs.ts +7 -7
- package/src/parser/applyViewboxTransform.ts +2 -4
- package/src/shapes/IText/IText.ts +1 -2
- package/src/shapes/IText/ITextBehavior.test.ts +6 -6
- package/src/shapes/Object/FabricObject.spec.ts +3 -2
- package/src/shapes/Object/FabricObjectSVGExportMixin.ts +47 -37
- package/src/shapes/Object/InteractiveObject.ts +13 -3
- package/src/shapes/Object/Object-interactivity.spec.ts +126 -7
- package/src/shapes/Object/ObjectGeometry.spec.ts +10 -1
- package/src/shapes/Object/ObjectGeometry.ts +10 -3
- package/src/shapes/Object/objectSvgExport.spec.ts +27 -0
- package/src/shapes/Object/types/FabricObjectProps.ts +1 -1
- package/src/shapes/Text/Text.spec.ts +25 -0
- package/src/shapes/Text/Text.ts +5 -5
- package/src/shapes/Text/TextSVGExportMixin.ts +25 -11
- package/src/shapes/Textbox.ts +1 -2
- package/src/util/animation/animations.spec.ts +1 -1
- package/src/util/animation/easing.ts +1 -1
- package/src/util/internals/applyCanvasTransform.ts +1 -1
- package/src/util/internals/svgExportCheck.ts +20 -0
- package/src/util/misc/matrix.spec.ts +52 -0
- package/src/util/misc/matrix.ts +16 -0
- package/src/util/misc/mergeClipPaths.ts +1 -1
- package/src/util/misc/objectEnlive.ts +1 -1
- package/src/util/misc/svgParsing.ts +22 -10
- package/src/util/path/index.ts +3 -2
- package/src/util/path/regex.ts +1 -1
- package/src/util/typeAssertions.spec.ts +1 -1
- /package/dist/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/defineProperty.min.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/toPrimitive.min.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/toPropertyKey.min.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/typeof.min.mjs +0 -0
package/dist/index.node.cjs
CHANGED
|
@@ -374,7 +374,7 @@ var Cache = class {
|
|
|
374
374
|
const cache = new Cache();
|
|
375
375
|
//#endregion
|
|
376
376
|
//#region src/constants.ts
|
|
377
|
-
const VERSION = "7.
|
|
377
|
+
const VERSION = "7.4.0";
|
|
378
378
|
function noop() {}
|
|
379
379
|
const halfPI = Math.PI / 2;
|
|
380
380
|
const quarterPI = Math.PI / 4;
|
|
@@ -1346,6 +1346,20 @@ const multiplyTransformMatrices = (a, b, is2x2) => [
|
|
|
1346
1346
|
const multiplyTransformMatrixArray = (matrices, is2x2) => matrices.reduceRight((product, curr) => curr && product ? multiplyTransformMatrices(curr, product, is2x2) : curr || product, void 0) || iMatrix.concat();
|
|
1347
1347
|
const calcPlaneRotation = ([a, b]) => Math.atan2(b, a);
|
|
1348
1348
|
/**
|
|
1349
|
+
* Returns the uniform scale (zoom) magnitude of a 2D affine matrix,
|
|
1350
|
+
* computed as the length of the image of the unit X basis vector.
|
|
1351
|
+
*/
|
|
1352
|
+
const calcPlaneZoom = ([a, b]) => Math.sqrt(a * a + b * b);
|
|
1353
|
+
/**
|
|
1354
|
+
* Returns the Y-axis scale magnitude of a 2D affine matrix,
|
|
1355
|
+
* computed as the length of the image of the unit Y basis vector.
|
|
1356
|
+
* We do not support non uniform zooming on the viewport but to make things work
|
|
1357
|
+
* we need to have a function that can return the value on Y axis.
|
|
1358
|
+
* Bug reports and features will be planned with zoom being just a number
|
|
1359
|
+
* that is the same for both axis
|
|
1360
|
+
*/
|
|
1361
|
+
const calcPlaneScaleY = ([, , c, d]) => Math.sqrt(c * c + d * d);
|
|
1362
|
+
/**
|
|
1349
1363
|
* Decomposes standard 2x3 matrix into transform components
|
|
1350
1364
|
* @param {TMat2D} a transformMatrix
|
|
1351
1365
|
* @return {Object} Components of transform
|
|
@@ -1604,7 +1618,7 @@ const enlivenObjectEnlivables = (serializedObject, { signal } = {}) => new Promi
|
|
|
1604
1618
|
/**
|
|
1605
1619
|
* clipPath or shadow or gradient or text on a path or a pattern,
|
|
1606
1620
|
* or the backgroundImage or overlayImage of canvas
|
|
1607
|
-
* If we have a type and there is a
|
|
1621
|
+
* If we have a type and there is a class registered for it, we enlive it.
|
|
1608
1622
|
* If there is no class registered for it we return the value as is
|
|
1609
1623
|
* */
|
|
1610
1624
|
if (value.type && classRegistry.has(value.type)) return enlivenObjects([value], { signal }).then(([enlived]) => {
|
|
@@ -2035,11 +2049,11 @@ var StaticCanvas$1 = class StaticCanvas$1 extends createCollectionMixin(CommonMe
|
|
|
2035
2049
|
if (!options || !options.cssOnly) this.requestRenderAll();
|
|
2036
2050
|
}
|
|
2037
2051
|
/**
|
|
2038
|
-
* Returns canvas zoom level
|
|
2052
|
+
* Returns the canvas zoom level as the magnitude of the viewport scale.
|
|
2039
2053
|
* @return {Number}
|
|
2040
2054
|
*/
|
|
2041
2055
|
getZoom() {
|
|
2042
|
-
return this.viewportTransform
|
|
2056
|
+
return calcPlaneZoom(this.viewportTransform);
|
|
2043
2057
|
}
|
|
2044
2058
|
/**
|
|
2045
2059
|
* Sets viewport transformation of this canvas instance
|
|
@@ -3173,6 +3187,15 @@ function getLocalPoint({ target, corner }, originX, originY, x, y) {
|
|
|
3173
3187
|
return localPoint;
|
|
3174
3188
|
}
|
|
3175
3189
|
//#endregion
|
|
3190
|
+
//#region src/util/internals/svgExportCheck.ts
|
|
3191
|
+
const unsafeSvgStyleValueRegex = new RegExp(String.raw`[\0-\x1F\x7F;<>\\]|\/\*|\*\/|url\s*\(|expression\s*\(|(?:java|vb)script\s*:|data\s*:|@import\b`, "iu");
|
|
3192
|
+
const isSafeSvgStyleValue = (value) => typeof value === "string" && value.trim().length > 0 && !unsafeSvgStyleValueRegex.test(value);
|
|
3193
|
+
const getSafeSvgStyleNumber = (value, fallback = "") => {
|
|
3194
|
+
const numeric = Number(value);
|
|
3195
|
+
return Number.isFinite(numeric) ? `${numeric}` : fallback;
|
|
3196
|
+
};
|
|
3197
|
+
const getSafeSvgStyleToken = (value, fallback = "") => typeof value === "string" && isSafeSvgStyleValue(value) ? value : fallback;
|
|
3198
|
+
//#endregion
|
|
3176
3199
|
//#region src/util/internals/normalizeWhiteSpace.ts
|
|
3177
3200
|
const normalizeWs = (value) => value.replace(/\s+/g, " ");
|
|
3178
3201
|
//#endregion
|
|
@@ -3901,9 +3924,13 @@ const colorPropToSVG = (prop, value, inlineStyle = true) => {
|
|
|
3901
3924
|
if (!value) colorValue = "none";
|
|
3902
3925
|
else if (value.toLive) colorValue = `url(#SVGID_${escapeXml(value.id)})`;
|
|
3903
3926
|
else {
|
|
3904
|
-
const
|
|
3905
|
-
colorValue =
|
|
3906
|
-
|
|
3927
|
+
const rawValue = String(value);
|
|
3928
|
+
if (!isSafeSvgStyleValue(rawValue)) colorValue = new Color("black").toRgb();
|
|
3929
|
+
else {
|
|
3930
|
+
const color = new Color(rawValue), opacity = color.getAlpha();
|
|
3931
|
+
colorValue = color.toRgb();
|
|
3932
|
+
if (opacity !== 1) opacityValue = opacity.toString();
|
|
3933
|
+
}
|
|
3907
3934
|
}
|
|
3908
3935
|
if (inlineStyle) return `${prop}: ${colorValue}; ${opacityValue ? `${prop}-opacity: ${opacityValue}; ` : ""}`;
|
|
3909
3936
|
else return `${prop}="${colorValue}" ${opacityValue ? `${prop}-opacity="${opacityValue}" ` : ""}`;
|
|
@@ -3927,34 +3954,18 @@ var FabricObjectSVGExportMixin = class {
|
|
|
3927
3954
|
* @return {String}
|
|
3928
3955
|
*/
|
|
3929
3956
|
getSvgStyles(skipShadow) {
|
|
3930
|
-
const fillRule = this.fillRule
|
|
3957
|
+
const fillRule = this.fillRule == null ? "nonzero" : getSafeSvgStyleToken(this.fillRule), strokeWidth = this.strokeWidth == null ? "0" : getSafeSvgStyleNumber(this.strokeWidth), strokeDashArray = this.strokeDashArray == null ? NONE : this.strokeDashArray.every((value) => Number.isFinite(Number(value))) ? this.strokeDashArray.join(" ") : "", strokeDashOffset = this.strokeDashOffset == null ? "0" : getSafeSvgStyleNumber(this.strokeDashOffset), strokeLineCap = this.strokeLineCap == null ? "butt" : getSafeSvgStyleToken(this.strokeLineCap), strokeLineJoin = this.strokeLineJoin == null ? "miter" : getSafeSvgStyleToken(this.strokeLineJoin), strokeMiterLimit = this.strokeMiterLimit == null ? "4" : getSafeSvgStyleNumber(this.strokeMiterLimit), opacity = this.opacity == null ? "1" : getSafeSvgStyleNumber(this.opacity), visibility = this.visible ? "" : " visibility: hidden;", filter = skipShadow ? "" : this.getSvgFilter(), fill = colorPropToSVG(FILL, this.fill);
|
|
3931
3958
|
return [
|
|
3932
3959
|
colorPropToSVG(STROKE, this.stroke),
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
"stroke-linecap: ",
|
|
3940
|
-
strokeLineCap,
|
|
3941
|
-
"; ",
|
|
3942
|
-
"stroke-dashoffset: ",
|
|
3943
|
-
strokeDashOffset,
|
|
3944
|
-
"; ",
|
|
3945
|
-
"stroke-linejoin: ",
|
|
3946
|
-
strokeLineJoin,
|
|
3947
|
-
"; ",
|
|
3948
|
-
"stroke-miterlimit: ",
|
|
3949
|
-
strokeMiterLimit,
|
|
3950
|
-
"; ",
|
|
3960
|
+
strokeWidth ? `stroke-width: ${strokeWidth}; ` : "",
|
|
3961
|
+
strokeDashArray ? `stroke-dasharray: ${strokeDashArray}; ` : "",
|
|
3962
|
+
strokeLineCap ? `stroke-linecap: ${strokeLineCap}; ` : "",
|
|
3963
|
+
strokeDashOffset ? `stroke-dashoffset: ${strokeDashOffset}; ` : "",
|
|
3964
|
+
strokeLineJoin ? `stroke-linejoin: ${strokeLineJoin}; ` : "",
|
|
3965
|
+
strokeMiterLimit ? `stroke-miterlimit: ${strokeMiterLimit}; ` : "",
|
|
3951
3966
|
fill,
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
"; ",
|
|
3955
|
-
"opacity: ",
|
|
3956
|
-
opacity,
|
|
3957
|
-
";",
|
|
3967
|
+
fillRule ? `fill-rule: ${fillRule}; ` : "",
|
|
3968
|
+
opacity ? `opacity: ${opacity};` : "",
|
|
3958
3969
|
filter,
|
|
3959
3970
|
visibility
|
|
3960
3971
|
].map((v) => escapeXml(v)).join("");
|
|
@@ -3971,7 +3982,7 @@ var FabricObjectSVGExportMixin = class {
|
|
|
3971
3982
|
* @return {String}
|
|
3972
3983
|
*/
|
|
3973
3984
|
getSvgCommons() {
|
|
3974
|
-
return [this.id ? `id="${escapeXml(String(this.id))}" ` : "", this.clipPath ? `clip-path="url(#${this.clipPath.clipPathId})" ` : ""].join("");
|
|
3985
|
+
return [this.id ? `id="${escapeXml(String(this.id))}" ` : "", this.clipPath ? `clip-path="url(#${escapeXml(this.clipPath.clipPathId)})" ` : ""].join("");
|
|
3975
3986
|
}
|
|
3976
3987
|
/**
|
|
3977
3988
|
* Returns transform-string for svg-export
|
|
@@ -4569,7 +4580,7 @@ const easeInOutExpo = (t, b, c, d) => {
|
|
|
4569
4580
|
if (t === d) return b + c;
|
|
4570
4581
|
t /= d / 2;
|
|
4571
4582
|
if (t < 1) return c / 2 * 2 ** (10 * (t - 1)) + b;
|
|
4572
|
-
return c / 2 * -(2 ** (-10 *
|
|
4583
|
+
return c / 2 * -(2 ** (-10 * (t - 1)) + 2) + b;
|
|
4573
4584
|
};
|
|
4574
4585
|
/**
|
|
4575
4586
|
* Circular easing in
|
|
@@ -5372,7 +5383,10 @@ var ObjectGeometry = class extends CommonMethods {
|
|
|
5372
5383
|
* @returns {Point} dimensions
|
|
5373
5384
|
*/
|
|
5374
5385
|
_calculateCurrentDimensions(options) {
|
|
5375
|
-
|
|
5386
|
+
const vpt = this.canvas?.viewportTransform;
|
|
5387
|
+
const dim = this._getTransformedDimensions(options);
|
|
5388
|
+
if (vpt) return dim.multiply(new Point(calcPlaneZoom(vpt), calcPlaneScaleY(vpt))).scalarAdd(2 * this.padding);
|
|
5389
|
+
return dim.scalarAdd(2 * this.padding);
|
|
5376
5390
|
}
|
|
5377
5391
|
/**
|
|
5378
5392
|
* Calculate object bounding box dimensions from its properties scale, skew.
|
|
@@ -7548,11 +7562,11 @@ var InteractiveFabricObject = class InteractiveFabricObject extends FabricObject
|
|
|
7548
7562
|
* @return {Record<string, TOCoord>}
|
|
7549
7563
|
*/
|
|
7550
7564
|
calcOCoords() {
|
|
7551
|
-
const vpt = this.getViewportTransform(), center = this.getCenterPoint(), finalMatrix = multiplyTransformMatrices(multiplyTransformMatrices(vpt, multiplyTransformMatrices(createTranslateMatrix(center.x, center.y), createRotateMatrix({ angle: this.getTotalAngle() - (!!this.group && this.flipX ? 180 : 0) }))), [
|
|
7552
|
-
1 /
|
|
7565
|
+
const vpt = this.getViewportTransform(), vptScaleX = calcPlaneZoom(vpt), vptScaleY = calcPlaneScaleY(vpt), center = this.getCenterPoint(), finalMatrix = multiplyTransformMatrices(multiplyTransformMatrices(vpt, multiplyTransformMatrices(createTranslateMatrix(center.x, center.y), createRotateMatrix({ angle: this.getTotalAngle() - (!!this.group && this.flipX ? 180 : 0) }))), [
|
|
7566
|
+
1 / vptScaleX,
|
|
7553
7567
|
0,
|
|
7554
7568
|
0,
|
|
7555
|
-
1 /
|
|
7569
|
+
1 / vptScaleY,
|
|
7556
7570
|
0,
|
|
7557
7571
|
0
|
|
7558
7572
|
]), transformOptions = this.group ? qrDecompose(this.calcTransformMatrix()) : void 0;
|
|
@@ -7668,7 +7682,8 @@ var InteractiveFabricObject = class InteractiveFabricObject extends FabricObject
|
|
|
7668
7682
|
ctx.lineWidth = this.borderScaleFactor;
|
|
7669
7683
|
if (this.group === this.parent) ctx.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1;
|
|
7670
7684
|
if (this.flipX) options.angle -= 180;
|
|
7671
|
-
|
|
7685
|
+
const vptAngle = calcPlaneRotation(vpt);
|
|
7686
|
+
ctx.rotate(this.group ? degreesToRadians(options.angle) : degreesToRadians(this.angle) + vptAngle);
|
|
7672
7687
|
shouldDrawBorders && this.drawBorders(ctx, options, styleOverride);
|
|
7673
7688
|
shouldDrawControls && this.drawControls(ctx, styleOverride);
|
|
7674
7689
|
ctx.restore();
|
|
@@ -9499,7 +9514,7 @@ const commaWsp = `\\s*,?\\s*`;
|
|
|
9499
9514
|
/**
|
|
9500
9515
|
* p for param
|
|
9501
9516
|
* using "bad naming" here because it makes the regex much easier to read
|
|
9502
|
-
* p is a number that is preceded by an
|
|
9517
|
+
* p is a number that is preceded by an arbitrary number of spaces, maybe 0,
|
|
9503
9518
|
* a comma or not, and then possibly more spaces or not.
|
|
9504
9519
|
*/
|
|
9505
9520
|
const p = `${commaWsp}(${reNum})`;
|
|
@@ -10063,7 +10078,8 @@ const parsePath = (pathString) => {
|
|
|
10063
10078
|
let paramArr = [];
|
|
10064
10079
|
if (commandLetter === "a" || commandLetter === "A") {
|
|
10065
10080
|
regExpArcCommandPoints.lastIndex = 0;
|
|
10066
|
-
|
|
10081
|
+
let out;
|
|
10082
|
+
while (out = regExpArcCommandPoints.exec(matchStr)) paramArr.push(...out.slice(1));
|
|
10067
10083
|
} else paramArr = matchStr.match(reMyNum) || [];
|
|
10068
10084
|
for (let i = 0; i < paramArr.length; i += commandLength) {
|
|
10069
10085
|
const newCommand = new Array(commandLength);
|
|
@@ -10192,7 +10208,7 @@ const joinPath = (pathData, fractionDigits) => pathData.map((segment) => {
|
|
|
10192
10208
|
* Merges 2 clip paths into one visually equal clip path
|
|
10193
10209
|
*
|
|
10194
10210
|
* **IMPORTANT**:\
|
|
10195
|
-
* Does **NOT** clone the arguments, clone them
|
|
10211
|
+
* Does **NOT** clone the arguments, clone them prior if necessary.
|
|
10196
10212
|
*
|
|
10197
10213
|
* Creates a wrapper (group) that contains one clip path and is clipped by the other so content is kept where both overlap.
|
|
10198
10214
|
* Use this method if both the clip paths may have nested clip paths of their own, so assigning one to the other's clip path property is not possible.
|
|
@@ -12906,7 +12922,9 @@ var Gradient = class {
|
|
|
12906
12922
|
}
|
|
12907
12923
|
}
|
|
12908
12924
|
colorStops.forEach(({ color, offset }) => {
|
|
12909
|
-
|
|
12925
|
+
const rawColor = String(color);
|
|
12926
|
+
const serializedColor = isSafeSvgStyleValue(rawColor) ? rawColor : new Color(rawColor).toRgba();
|
|
12927
|
+
markup.push(`<stop offset="${offset * 100}%" style="stop-color:${escapeXml(serializedColor)};"/>\n`);
|
|
12910
12928
|
});
|
|
12911
12929
|
markup.push(this.type === "linear" ? "</linearGradient>" : "</radialGradient>", "\n");
|
|
12912
12930
|
return markup.join("");
|
|
@@ -15104,7 +15122,7 @@ var TextSVGExportMixin = class extends FabricObjectSVGExportMixin {
|
|
|
15104
15122
|
* @return {String}
|
|
15105
15123
|
*/
|
|
15106
15124
|
getSvgStyles(skipShadow) {
|
|
15107
|
-
const objectLevelTextDecorationColor = this["textDecorationColor"] ? ` text-decoration-color: ${escapeXml(this[TEXT_DECORATION_COLOR])};` : "";
|
|
15125
|
+
const objectLevelTextDecorationColor = isSafeSvgStyleValue(this["textDecorationColor"]) ? ` text-decoration-color: ${escapeXml(this[TEXT_DECORATION_COLOR])};` : "";
|
|
15108
15126
|
return `${super.getSvgStyles(skipShadow)} text-decoration-thickness: ${toFixed(this.textDecorationThickness * this.getObjectScaling().y / 10, config.NUM_FRACTION_DIGITS)}%;${objectLevelTextDecorationColor} white-space: pre;`;
|
|
15109
15127
|
}
|
|
15110
15128
|
/**
|
|
@@ -15122,14 +15140,20 @@ var TextSVGExportMixin = class extends FabricObjectSVGExportMixin {
|
|
|
15122
15140
|
});
|
|
15123
15141
|
const thickness = textDecorationThickness || this["textDecorationThickness"];
|
|
15124
15142
|
const decorationColor = textDecorationColor || this["textDecorationColor"];
|
|
15143
|
+
const safeStrokeWidth = getSafeSvgStyleNumber(strokeWidth);
|
|
15144
|
+
const safeFontFamily = getSafeSvgStyleToken(fontFamily);
|
|
15145
|
+
const safeFontSize = getSafeSvgStyleNumber(fontSize);
|
|
15146
|
+
const safeFontStyle = getSafeSvgStyleToken(fontStyle);
|
|
15147
|
+
const safeFontWeight = getSafeSvgStyleNumber(fontWeight) || getSafeSvgStyleToken(fontWeight);
|
|
15148
|
+
const safeDecorationColor = getSafeSvgStyleToken(decorationColor);
|
|
15125
15149
|
return [
|
|
15126
15150
|
stroke ? colorPropToSVG(STROKE, stroke) : "",
|
|
15127
|
-
|
|
15128
|
-
|
|
15129
|
-
|
|
15130
|
-
|
|
15131
|
-
|
|
15132
|
-
textDecoration ? `text-decoration: ${textDecoration}; text-decoration-thickness: ${toFixed(thickness * this.getObjectScaling().y / 10, config.NUM_FRACTION_DIGITS)}%;${
|
|
15151
|
+
safeStrokeWidth ? `stroke-width: ${escapeXml(safeStrokeWidth)}; ` : "",
|
|
15152
|
+
safeFontFamily ? `font-family: ${!safeFontFamily.includes("'") && !safeFontFamily.includes("\"") ? `'${escapeXml(safeFontFamily)}'` : escapeXml(safeFontFamily)}; ` : "",
|
|
15153
|
+
safeFontSize ? `font-size: ${escapeXml(safeFontSize)}px; ` : "",
|
|
15154
|
+
safeFontStyle ? `font-style: ${escapeXml(safeFontStyle)}; ` : "",
|
|
15155
|
+
safeFontWeight ? `font-weight: ${escapeXml(safeFontWeight)}; ` : "",
|
|
15156
|
+
textDecoration ? `text-decoration: ${textDecoration}; text-decoration-thickness: ${toFixed(thickness * this.getObjectScaling().y / 10, config.NUM_FRACTION_DIGITS)}%;${safeDecorationColor ? ` text-decoration-color: ${escapeXml(safeDecorationColor)};` : ""} ` : "",
|
|
15133
15157
|
fill ? colorPropToSVG(FILL, fill) : "",
|
|
15134
15158
|
useWhiteSpace ? "white-space: pre; " : ""
|
|
15135
15159
|
].join("");
|
|
@@ -15691,7 +15715,7 @@ var FabricText = class FabricText extends StyledText {
|
|
|
15691
15715
|
* @private
|
|
15692
15716
|
* @param {String} method fillText or strokeText.
|
|
15693
15717
|
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
15694
|
-
* @param {Array} line Content of the line,
|
|
15718
|
+
* @param {Array} line Content of the line, split in an array by grapheme
|
|
15695
15719
|
* @param {Number} left
|
|
15696
15720
|
* @param {Number} top
|
|
15697
15721
|
* @param {Number} lineIndex
|
|
@@ -15960,7 +15984,7 @@ var FabricText = class FabricText extends StyledText {
|
|
|
15960
15984
|
let lastDecorationColor = this.getValueOfPropertyAt(i, 0, "textDecorationColor") || lastFill;
|
|
15961
15985
|
let lastTickness = this.getValueOfPropertyAt(i, 0, TEXT_DECORATION_THICKNESS);
|
|
15962
15986
|
let currentDecoration = lastDecoration;
|
|
15963
|
-
let currentFill
|
|
15987
|
+
let currentFill;
|
|
15964
15988
|
let currentDecorationColor = lastDecorationColor;
|
|
15965
15989
|
let currentTickness = lastTickness;
|
|
15966
15990
|
const top = topOffset + maxHeight * (1 - this._fontSizeFraction);
|
|
@@ -17719,7 +17743,7 @@ const ctrlKeysMapDown = { 65: "cmdAll" };
|
|
|
17719
17743
|
* Set the transform of the passed context to the same of a specific Canvas or StaticCanvas.
|
|
17720
17744
|
* setTransform is used since this utility will RESET the ctx transform to the basic value
|
|
17721
17745
|
* of retina scaling and viewport transform
|
|
17722
|
-
* It is not meant to be added to other transforms, it is used internally to
|
|
17746
|
+
* It is not meant to be added to other transforms, it is used internally to prepare canvases to draw
|
|
17723
17747
|
* @param ctx
|
|
17724
17748
|
* @param canvas
|
|
17725
17749
|
*/
|
|
@@ -18119,7 +18143,7 @@ var IText = class IText extends ITextClickBehavior {
|
|
|
18119
18143
|
const selectionStart = selection.selectionStart, selectionEnd = selection.selectionEnd, isJustify = textAlign.includes(JUSTIFY), start = this.get2DCursorLocation(selectionStart), end = this.get2DCursorLocation(selectionEnd), startLine = start.lineIndex, endLine = end.lineIndex, startChar = start.charIndex < 0 ? 0 : start.charIndex, endChar = end.charIndex < 0 ? 0 : end.charIndex;
|
|
18120
18144
|
for (let i = startLine; i <= endLine; i++) {
|
|
18121
18145
|
const lineOffset = this._getLineLeftOffset(i) || 0;
|
|
18122
|
-
let lineHeight = this.getHeightOfLine(i),
|
|
18146
|
+
let lineHeight = this.getHeightOfLine(i), boxStart = 0, boxEnd = 0;
|
|
18123
18147
|
if (i === startLine) boxStart = this.__charBounds[startLine][startChar].left;
|
|
18124
18148
|
if (i >= startLine && i < endLine) boxEnd = isJustify && !this.isEndOfWrapping(i) ? this.width : this.getLineWidth(i) || 5;
|
|
18125
18149
|
else if (i === endLine) if (endChar === 0) boxEnd = this.__charBounds[endLine][endChar].left;
|
|
@@ -18127,7 +18151,7 @@ var IText = class IText extends ITextClickBehavior {
|
|
|
18127
18151
|
const charSpacing = this._getWidthOfCharSpacing();
|
|
18128
18152
|
boxEnd = this.__charBounds[endLine][endChar - 1].left + this.__charBounds[endLine][endChar - 1].width - charSpacing;
|
|
18129
18153
|
}
|
|
18130
|
-
realLineHeight = lineHeight;
|
|
18154
|
+
const realLineHeight = lineHeight;
|
|
18131
18155
|
if (this.lineHeight < 1 || i === endLine && this.lineHeight > 1) lineHeight /= this.lineHeight;
|
|
18132
18156
|
let drawStart = boundaries.left + lineOffset + boxStart, drawHeight = lineHeight, extraTop = 0;
|
|
18133
18157
|
const drawWidth = boxEnd - boxStart;
|
|
@@ -18295,7 +18319,7 @@ var Textbox = class Textbox extends IText {
|
|
|
18295
18319
|
*/
|
|
18296
18320
|
isEmptyStyles(lineIndex) {
|
|
18297
18321
|
if (!this.styles) return true;
|
|
18298
|
-
let offset = 0, nextLineIndex
|
|
18322
|
+
let offset = 0, nextLineIndex, nextOffset, shouldLimit = false;
|
|
18299
18323
|
const map = this._styleMap[lineIndex], mapNextLine = this._styleMap[lineIndex + 1];
|
|
18300
18324
|
if (map) {
|
|
18301
18325
|
lineIndex = map.line;
|
|
@@ -18466,7 +18490,6 @@ var Textbox = class Textbox extends IText {
|
|
|
18466
18490
|
desiredWidth -= reservedSpace;
|
|
18467
18491
|
const maxWidth = Math.max(desiredWidth, largestWordWidth, this.dynamicMinWidth);
|
|
18468
18492
|
const data = wordsData[lineIndex];
|
|
18469
|
-
offset = 0;
|
|
18470
18493
|
let i;
|
|
18471
18494
|
for (i = 0; i < data.length; i++) {
|
|
18472
18495
|
const { word, width: wordWidth } = data[i];
|
|
@@ -19610,8 +19633,6 @@ function applyViewboxTransform(element) {
|
|
|
19610
19633
|
const viewBoxAttr = element.getAttribute("viewBox");
|
|
19611
19634
|
let scaleX = 1;
|
|
19612
19635
|
let scaleY = 1;
|
|
19613
|
-
let minX = 0;
|
|
19614
|
-
let minY = 0;
|
|
19615
19636
|
let matrix;
|
|
19616
19637
|
let el;
|
|
19617
19638
|
const widthAttr = element.getAttribute("width");
|
|
@@ -19646,8 +19667,8 @@ function applyViewboxTransform(element) {
|
|
|
19646
19667
|
return parsedDim;
|
|
19647
19668
|
}
|
|
19648
19669
|
const pasedViewBox = viewBoxAttr.match(reViewBoxAttrValue);
|
|
19649
|
-
minX = -parseFloat(pasedViewBox[1]);
|
|
19650
|
-
minY = -parseFloat(pasedViewBox[2]);
|
|
19670
|
+
const minX = -parseFloat(pasedViewBox[1]);
|
|
19671
|
+
const minY = -parseFloat(pasedViewBox[2]);
|
|
19651
19672
|
const viewBoxWidth = parseFloat(pasedViewBox[3]);
|
|
19652
19673
|
const viewBoxHeight = parseFloat(pasedViewBox[4]);
|
|
19653
19674
|
parsedDim.minX = minX;
|
|
@@ -22478,7 +22499,7 @@ var Resize = class extends BaseFilter {
|
|
|
22478
22499
|
const ratioW = this.rcpScaleX, ratioH = this.rcpScaleY, ratioWHalf = Math.ceil(ratioW / 2), ratioHHalf = Math.ceil(ratioH / 2), data = options.imageData.data, img2 = options.ctx.createImageData(dW, dH), data2 = img2.data;
|
|
22479
22500
|
for (let j = 0; j < dH; j++) for (let i = 0; i < dW; i++) {
|
|
22480
22501
|
const x2 = (i + j * dW) * 4;
|
|
22481
|
-
let weight
|
|
22502
|
+
let weight;
|
|
22482
22503
|
let weights = 0;
|
|
22483
22504
|
let weightsAlpha = 0;
|
|
22484
22505
|
let gxR = 0;
|