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.mjs
CHANGED
|
@@ -353,7 +353,7 @@ var Cache = class {
|
|
|
353
353
|
const cache = new Cache();
|
|
354
354
|
//#endregion
|
|
355
355
|
//#region src/constants.ts
|
|
356
|
-
const VERSION = "7.
|
|
356
|
+
const VERSION = "7.4.0";
|
|
357
357
|
function noop() {}
|
|
358
358
|
const halfPI = Math.PI / 2;
|
|
359
359
|
const quarterPI = Math.PI / 4;
|
|
@@ -1325,6 +1325,20 @@ const multiplyTransformMatrices = (a, b, is2x2) => [
|
|
|
1325
1325
|
const multiplyTransformMatrixArray = (matrices, is2x2) => matrices.reduceRight((product, curr) => curr && product ? multiplyTransformMatrices(curr, product, is2x2) : curr || product, void 0) || iMatrix.concat();
|
|
1326
1326
|
const calcPlaneRotation = ([a, b]) => Math.atan2(b, a);
|
|
1327
1327
|
/**
|
|
1328
|
+
* Returns the uniform scale (zoom) magnitude of a 2D affine matrix,
|
|
1329
|
+
* computed as the length of the image of the unit X basis vector.
|
|
1330
|
+
*/
|
|
1331
|
+
const calcPlaneZoom = ([a, b]) => Math.sqrt(a * a + b * b);
|
|
1332
|
+
/**
|
|
1333
|
+
* Returns the Y-axis scale magnitude of a 2D affine matrix,
|
|
1334
|
+
* computed as the length of the image of the unit Y basis vector.
|
|
1335
|
+
* We do not support non uniform zooming on the viewport but to make things work
|
|
1336
|
+
* we need to have a function that can return the value on Y axis.
|
|
1337
|
+
* Bug reports and features will be planned with zoom being just a number
|
|
1338
|
+
* that is the same for both axis
|
|
1339
|
+
*/
|
|
1340
|
+
const calcPlaneScaleY = ([, , c, d]) => Math.sqrt(c * c + d * d);
|
|
1341
|
+
/**
|
|
1328
1342
|
* Decomposes standard 2x3 matrix into transform components
|
|
1329
1343
|
* @param {TMat2D} a transformMatrix
|
|
1330
1344
|
* @return {Object} Components of transform
|
|
@@ -1583,7 +1597,7 @@ const enlivenObjectEnlivables = (serializedObject, { signal } = {}) => new Promi
|
|
|
1583
1597
|
/**
|
|
1584
1598
|
* clipPath or shadow or gradient or text on a path or a pattern,
|
|
1585
1599
|
* or the backgroundImage or overlayImage of canvas
|
|
1586
|
-
* If we have a type and there is a
|
|
1600
|
+
* If we have a type and there is a class registered for it, we enlive it.
|
|
1587
1601
|
* If there is no class registered for it we return the value as is
|
|
1588
1602
|
* */
|
|
1589
1603
|
if (value.type && classRegistry.has(value.type)) return enlivenObjects([value], { signal }).then(([enlived]) => {
|
|
@@ -2014,11 +2028,11 @@ var StaticCanvas$1 = class StaticCanvas$1 extends createCollectionMixin(CommonMe
|
|
|
2014
2028
|
if (!options || !options.cssOnly) this.requestRenderAll();
|
|
2015
2029
|
}
|
|
2016
2030
|
/**
|
|
2017
|
-
* Returns canvas zoom level
|
|
2031
|
+
* Returns the canvas zoom level as the magnitude of the viewport scale.
|
|
2018
2032
|
* @return {Number}
|
|
2019
2033
|
*/
|
|
2020
2034
|
getZoom() {
|
|
2021
|
-
return this.viewportTransform
|
|
2035
|
+
return calcPlaneZoom(this.viewportTransform);
|
|
2022
2036
|
}
|
|
2023
2037
|
/**
|
|
2024
2038
|
* Sets viewport transformation of this canvas instance
|
|
@@ -3152,6 +3166,15 @@ function getLocalPoint({ target, corner }, originX, originY, x, y) {
|
|
|
3152
3166
|
return localPoint;
|
|
3153
3167
|
}
|
|
3154
3168
|
//#endregion
|
|
3169
|
+
//#region src/util/internals/svgExportCheck.ts
|
|
3170
|
+
const unsafeSvgStyleValueRegex = new RegExp(String.raw`[\0-\x1F\x7F;<>\\]|\/\*|\*\/|url\s*\(|expression\s*\(|(?:java|vb)script\s*:|data\s*:|@import\b`, "iu");
|
|
3171
|
+
const isSafeSvgStyleValue = (value) => typeof value === "string" && value.trim().length > 0 && !unsafeSvgStyleValueRegex.test(value);
|
|
3172
|
+
const getSafeSvgStyleNumber = (value, fallback = "") => {
|
|
3173
|
+
const numeric = Number(value);
|
|
3174
|
+
return Number.isFinite(numeric) ? `${numeric}` : fallback;
|
|
3175
|
+
};
|
|
3176
|
+
const getSafeSvgStyleToken = (value, fallback = "") => typeof value === "string" && isSafeSvgStyleValue(value) ? value : fallback;
|
|
3177
|
+
//#endregion
|
|
3155
3178
|
//#region src/util/internals/normalizeWhiteSpace.ts
|
|
3156
3179
|
const normalizeWs = (value) => value.replace(/\s+/g, " ");
|
|
3157
3180
|
//#endregion
|
|
@@ -3880,9 +3903,13 @@ const colorPropToSVG = (prop, value, inlineStyle = true) => {
|
|
|
3880
3903
|
if (!value) colorValue = "none";
|
|
3881
3904
|
else if (value.toLive) colorValue = `url(#SVGID_${escapeXml(value.id)})`;
|
|
3882
3905
|
else {
|
|
3883
|
-
const
|
|
3884
|
-
colorValue =
|
|
3885
|
-
|
|
3906
|
+
const rawValue = String(value);
|
|
3907
|
+
if (!isSafeSvgStyleValue(rawValue)) colorValue = new Color("black").toRgb();
|
|
3908
|
+
else {
|
|
3909
|
+
const color = new Color(rawValue), opacity = color.getAlpha();
|
|
3910
|
+
colorValue = color.toRgb();
|
|
3911
|
+
if (opacity !== 1) opacityValue = opacity.toString();
|
|
3912
|
+
}
|
|
3886
3913
|
}
|
|
3887
3914
|
if (inlineStyle) return `${prop}: ${colorValue}; ${opacityValue ? `${prop}-opacity: ${opacityValue}; ` : ""}`;
|
|
3888
3915
|
else return `${prop}="${colorValue}" ${opacityValue ? `${prop}-opacity="${opacityValue}" ` : ""}`;
|
|
@@ -3906,34 +3933,18 @@ var FabricObjectSVGExportMixin = class {
|
|
|
3906
3933
|
* @return {String}
|
|
3907
3934
|
*/
|
|
3908
3935
|
getSvgStyles(skipShadow) {
|
|
3909
|
-
const fillRule = this.fillRule
|
|
3936
|
+
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);
|
|
3910
3937
|
return [
|
|
3911
3938
|
colorPropToSVG(STROKE, this.stroke),
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
"stroke-linecap: ",
|
|
3919
|
-
strokeLineCap,
|
|
3920
|
-
"; ",
|
|
3921
|
-
"stroke-dashoffset: ",
|
|
3922
|
-
strokeDashOffset,
|
|
3923
|
-
"; ",
|
|
3924
|
-
"stroke-linejoin: ",
|
|
3925
|
-
strokeLineJoin,
|
|
3926
|
-
"; ",
|
|
3927
|
-
"stroke-miterlimit: ",
|
|
3928
|
-
strokeMiterLimit,
|
|
3929
|
-
"; ",
|
|
3939
|
+
strokeWidth ? `stroke-width: ${strokeWidth}; ` : "",
|
|
3940
|
+
strokeDashArray ? `stroke-dasharray: ${strokeDashArray}; ` : "",
|
|
3941
|
+
strokeLineCap ? `stroke-linecap: ${strokeLineCap}; ` : "",
|
|
3942
|
+
strokeDashOffset ? `stroke-dashoffset: ${strokeDashOffset}; ` : "",
|
|
3943
|
+
strokeLineJoin ? `stroke-linejoin: ${strokeLineJoin}; ` : "",
|
|
3944
|
+
strokeMiterLimit ? `stroke-miterlimit: ${strokeMiterLimit}; ` : "",
|
|
3930
3945
|
fill,
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
"; ",
|
|
3934
|
-
"opacity: ",
|
|
3935
|
-
opacity,
|
|
3936
|
-
";",
|
|
3946
|
+
fillRule ? `fill-rule: ${fillRule}; ` : "",
|
|
3947
|
+
opacity ? `opacity: ${opacity};` : "",
|
|
3937
3948
|
filter,
|
|
3938
3949
|
visibility
|
|
3939
3950
|
].map((v) => escapeXml(v)).join("");
|
|
@@ -3950,7 +3961,7 @@ var FabricObjectSVGExportMixin = class {
|
|
|
3950
3961
|
* @return {String}
|
|
3951
3962
|
*/
|
|
3952
3963
|
getSvgCommons() {
|
|
3953
|
-
return [this.id ? `id="${escapeXml(String(this.id))}" ` : "", this.clipPath ? `clip-path="url(#${this.clipPath.clipPathId})" ` : ""].join("");
|
|
3964
|
+
return [this.id ? `id="${escapeXml(String(this.id))}" ` : "", this.clipPath ? `clip-path="url(#${escapeXml(this.clipPath.clipPathId)})" ` : ""].join("");
|
|
3954
3965
|
}
|
|
3955
3966
|
/**
|
|
3956
3967
|
* Returns transform-string for svg-export
|
|
@@ -4548,7 +4559,7 @@ const easeInOutExpo = (t, b, c, d) => {
|
|
|
4548
4559
|
if (t === d) return b + c;
|
|
4549
4560
|
t /= d / 2;
|
|
4550
4561
|
if (t < 1) return c / 2 * 2 ** (10 * (t - 1)) + b;
|
|
4551
|
-
return c / 2 * -(2 ** (-10 *
|
|
4562
|
+
return c / 2 * -(2 ** (-10 * (t - 1)) + 2) + b;
|
|
4552
4563
|
};
|
|
4553
4564
|
/**
|
|
4554
4565
|
* Circular easing in
|
|
@@ -5351,7 +5362,10 @@ var ObjectGeometry = class extends CommonMethods {
|
|
|
5351
5362
|
* @returns {Point} dimensions
|
|
5352
5363
|
*/
|
|
5353
5364
|
_calculateCurrentDimensions(options) {
|
|
5354
|
-
|
|
5365
|
+
const vpt = this.canvas?.viewportTransform;
|
|
5366
|
+
const dim = this._getTransformedDimensions(options);
|
|
5367
|
+
if (vpt) return dim.multiply(new Point(calcPlaneZoom(vpt), calcPlaneScaleY(vpt))).scalarAdd(2 * this.padding);
|
|
5368
|
+
return dim.scalarAdd(2 * this.padding);
|
|
5355
5369
|
}
|
|
5356
5370
|
/**
|
|
5357
5371
|
* Calculate object bounding box dimensions from its properties scale, skew.
|
|
@@ -7527,11 +7541,11 @@ var InteractiveFabricObject = class InteractiveFabricObject extends FabricObject
|
|
|
7527
7541
|
* @return {Record<string, TOCoord>}
|
|
7528
7542
|
*/
|
|
7529
7543
|
calcOCoords() {
|
|
7530
|
-
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) }))), [
|
|
7531
|
-
1 /
|
|
7544
|
+
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) }))), [
|
|
7545
|
+
1 / vptScaleX,
|
|
7532
7546
|
0,
|
|
7533
7547
|
0,
|
|
7534
|
-
1 /
|
|
7548
|
+
1 / vptScaleY,
|
|
7535
7549
|
0,
|
|
7536
7550
|
0
|
|
7537
7551
|
]), transformOptions = this.group ? qrDecompose(this.calcTransformMatrix()) : void 0;
|
|
@@ -7647,7 +7661,8 @@ var InteractiveFabricObject = class InteractiveFabricObject extends FabricObject
|
|
|
7647
7661
|
ctx.lineWidth = this.borderScaleFactor;
|
|
7648
7662
|
if (this.group === this.parent) ctx.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1;
|
|
7649
7663
|
if (this.flipX) options.angle -= 180;
|
|
7650
|
-
|
|
7664
|
+
const vptAngle = calcPlaneRotation(vpt);
|
|
7665
|
+
ctx.rotate(this.group ? degreesToRadians(options.angle) : degreesToRadians(this.angle) + vptAngle);
|
|
7651
7666
|
shouldDrawBorders && this.drawBorders(ctx, options, styleOverride);
|
|
7652
7667
|
shouldDrawControls && this.drawControls(ctx, styleOverride);
|
|
7653
7668
|
ctx.restore();
|
|
@@ -9478,7 +9493,7 @@ const commaWsp = `\\s*,?\\s*`;
|
|
|
9478
9493
|
/**
|
|
9479
9494
|
* p for param
|
|
9480
9495
|
* using "bad naming" here because it makes the regex much easier to read
|
|
9481
|
-
* p is a number that is preceded by an
|
|
9496
|
+
* p is a number that is preceded by an arbitrary number of spaces, maybe 0,
|
|
9482
9497
|
* a comma or not, and then possibly more spaces or not.
|
|
9483
9498
|
*/
|
|
9484
9499
|
const p = `${commaWsp}(${reNum})`;
|
|
@@ -10042,7 +10057,8 @@ const parsePath = (pathString) => {
|
|
|
10042
10057
|
let paramArr = [];
|
|
10043
10058
|
if (commandLetter === "a" || commandLetter === "A") {
|
|
10044
10059
|
regExpArcCommandPoints.lastIndex = 0;
|
|
10045
|
-
|
|
10060
|
+
let out;
|
|
10061
|
+
while (out = regExpArcCommandPoints.exec(matchStr)) paramArr.push(...out.slice(1));
|
|
10046
10062
|
} else paramArr = matchStr.match(reMyNum) || [];
|
|
10047
10063
|
for (let i = 0; i < paramArr.length; i += commandLength) {
|
|
10048
10064
|
const newCommand = new Array(commandLength);
|
|
@@ -10171,7 +10187,7 @@ const joinPath = (pathData, fractionDigits) => pathData.map((segment) => {
|
|
|
10171
10187
|
* Merges 2 clip paths into one visually equal clip path
|
|
10172
10188
|
*
|
|
10173
10189
|
* **IMPORTANT**:\
|
|
10174
|
-
* Does **NOT** clone the arguments, clone them
|
|
10190
|
+
* Does **NOT** clone the arguments, clone them prior if necessary.
|
|
10175
10191
|
*
|
|
10176
10192
|
* Creates a wrapper (group) that contains one clip path and is clipped by the other so content is kept where both overlap.
|
|
10177
10193
|
* 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.
|
|
@@ -12885,7 +12901,9 @@ var Gradient = class {
|
|
|
12885
12901
|
}
|
|
12886
12902
|
}
|
|
12887
12903
|
colorStops.forEach(({ color, offset }) => {
|
|
12888
|
-
|
|
12904
|
+
const rawColor = String(color);
|
|
12905
|
+
const serializedColor = isSafeSvgStyleValue(rawColor) ? rawColor : new Color(rawColor).toRgba();
|
|
12906
|
+
markup.push(`<stop offset="${offset * 100}%" style="stop-color:${escapeXml(serializedColor)};"/>\n`);
|
|
12889
12907
|
});
|
|
12890
12908
|
markup.push(this.type === "linear" ? "</linearGradient>" : "</radialGradient>", "\n");
|
|
12891
12909
|
return markup.join("");
|
|
@@ -15083,7 +15101,7 @@ var TextSVGExportMixin = class extends FabricObjectSVGExportMixin {
|
|
|
15083
15101
|
* @return {String}
|
|
15084
15102
|
*/
|
|
15085
15103
|
getSvgStyles(skipShadow) {
|
|
15086
|
-
const objectLevelTextDecorationColor = this["textDecorationColor"] ? ` text-decoration-color: ${escapeXml(this[TEXT_DECORATION_COLOR])};` : "";
|
|
15104
|
+
const objectLevelTextDecorationColor = isSafeSvgStyleValue(this["textDecorationColor"]) ? ` text-decoration-color: ${escapeXml(this[TEXT_DECORATION_COLOR])};` : "";
|
|
15087
15105
|
return `${super.getSvgStyles(skipShadow)} text-decoration-thickness: ${toFixed(this.textDecorationThickness * this.getObjectScaling().y / 10, config.NUM_FRACTION_DIGITS)}%;${objectLevelTextDecorationColor} white-space: pre;`;
|
|
15088
15106
|
}
|
|
15089
15107
|
/**
|
|
@@ -15101,14 +15119,20 @@ var TextSVGExportMixin = class extends FabricObjectSVGExportMixin {
|
|
|
15101
15119
|
});
|
|
15102
15120
|
const thickness = textDecorationThickness || this["textDecorationThickness"];
|
|
15103
15121
|
const decorationColor = textDecorationColor || this["textDecorationColor"];
|
|
15122
|
+
const safeStrokeWidth = getSafeSvgStyleNumber(strokeWidth);
|
|
15123
|
+
const safeFontFamily = getSafeSvgStyleToken(fontFamily);
|
|
15124
|
+
const safeFontSize = getSafeSvgStyleNumber(fontSize);
|
|
15125
|
+
const safeFontStyle = getSafeSvgStyleToken(fontStyle);
|
|
15126
|
+
const safeFontWeight = getSafeSvgStyleNumber(fontWeight) || getSafeSvgStyleToken(fontWeight);
|
|
15127
|
+
const safeDecorationColor = getSafeSvgStyleToken(decorationColor);
|
|
15104
15128
|
return [
|
|
15105
15129
|
stroke ? colorPropToSVG(STROKE, stroke) : "",
|
|
15106
|
-
|
|
15107
|
-
|
|
15108
|
-
|
|
15109
|
-
|
|
15110
|
-
|
|
15111
|
-
textDecoration ? `text-decoration: ${textDecoration}; text-decoration-thickness: ${toFixed(thickness * this.getObjectScaling().y / 10, config.NUM_FRACTION_DIGITS)}%;${
|
|
15130
|
+
safeStrokeWidth ? `stroke-width: ${escapeXml(safeStrokeWidth)}; ` : "",
|
|
15131
|
+
safeFontFamily ? `font-family: ${!safeFontFamily.includes("'") && !safeFontFamily.includes("\"") ? `'${escapeXml(safeFontFamily)}'` : escapeXml(safeFontFamily)}; ` : "",
|
|
15132
|
+
safeFontSize ? `font-size: ${escapeXml(safeFontSize)}px; ` : "",
|
|
15133
|
+
safeFontStyle ? `font-style: ${escapeXml(safeFontStyle)}; ` : "",
|
|
15134
|
+
safeFontWeight ? `font-weight: ${escapeXml(safeFontWeight)}; ` : "",
|
|
15135
|
+
textDecoration ? `text-decoration: ${textDecoration}; text-decoration-thickness: ${toFixed(thickness * this.getObjectScaling().y / 10, config.NUM_FRACTION_DIGITS)}%;${safeDecorationColor ? ` text-decoration-color: ${escapeXml(safeDecorationColor)};` : ""} ` : "",
|
|
15112
15136
|
fill ? colorPropToSVG(FILL, fill) : "",
|
|
15113
15137
|
useWhiteSpace ? "white-space: pre; " : ""
|
|
15114
15138
|
].join("");
|
|
@@ -15670,7 +15694,7 @@ var FabricText = class FabricText extends StyledText {
|
|
|
15670
15694
|
* @private
|
|
15671
15695
|
* @param {String} method fillText or strokeText.
|
|
15672
15696
|
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
15673
|
-
* @param {Array} line Content of the line,
|
|
15697
|
+
* @param {Array} line Content of the line, split in an array by grapheme
|
|
15674
15698
|
* @param {Number} left
|
|
15675
15699
|
* @param {Number} top
|
|
15676
15700
|
* @param {Number} lineIndex
|
|
@@ -15939,7 +15963,7 @@ var FabricText = class FabricText extends StyledText {
|
|
|
15939
15963
|
let lastDecorationColor = this.getValueOfPropertyAt(i, 0, "textDecorationColor") || lastFill;
|
|
15940
15964
|
let lastTickness = this.getValueOfPropertyAt(i, 0, TEXT_DECORATION_THICKNESS);
|
|
15941
15965
|
let currentDecoration = lastDecoration;
|
|
15942
|
-
let currentFill
|
|
15966
|
+
let currentFill;
|
|
15943
15967
|
let currentDecorationColor = lastDecorationColor;
|
|
15944
15968
|
let currentTickness = lastTickness;
|
|
15945
15969
|
const top = topOffset + maxHeight * (1 - this._fontSizeFraction);
|
|
@@ -17698,7 +17722,7 @@ const ctrlKeysMapDown = { 65: "cmdAll" };
|
|
|
17698
17722
|
* Set the transform of the passed context to the same of a specific Canvas or StaticCanvas.
|
|
17699
17723
|
* setTransform is used since this utility will RESET the ctx transform to the basic value
|
|
17700
17724
|
* of retina scaling and viewport transform
|
|
17701
|
-
* It is not meant to be added to other transforms, it is used internally to
|
|
17725
|
+
* It is not meant to be added to other transforms, it is used internally to prepare canvases to draw
|
|
17702
17726
|
* @param ctx
|
|
17703
17727
|
* @param canvas
|
|
17704
17728
|
*/
|
|
@@ -18098,7 +18122,7 @@ var IText = class IText extends ITextClickBehavior {
|
|
|
18098
18122
|
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;
|
|
18099
18123
|
for (let i = startLine; i <= endLine; i++) {
|
|
18100
18124
|
const lineOffset = this._getLineLeftOffset(i) || 0;
|
|
18101
|
-
let lineHeight = this.getHeightOfLine(i),
|
|
18125
|
+
let lineHeight = this.getHeightOfLine(i), boxStart = 0, boxEnd = 0;
|
|
18102
18126
|
if (i === startLine) boxStart = this.__charBounds[startLine][startChar].left;
|
|
18103
18127
|
if (i >= startLine && i < endLine) boxEnd = isJustify && !this.isEndOfWrapping(i) ? this.width : this.getLineWidth(i) || 5;
|
|
18104
18128
|
else if (i === endLine) if (endChar === 0) boxEnd = this.__charBounds[endLine][endChar].left;
|
|
@@ -18106,7 +18130,7 @@ var IText = class IText extends ITextClickBehavior {
|
|
|
18106
18130
|
const charSpacing = this._getWidthOfCharSpacing();
|
|
18107
18131
|
boxEnd = this.__charBounds[endLine][endChar - 1].left + this.__charBounds[endLine][endChar - 1].width - charSpacing;
|
|
18108
18132
|
}
|
|
18109
|
-
realLineHeight = lineHeight;
|
|
18133
|
+
const realLineHeight = lineHeight;
|
|
18110
18134
|
if (this.lineHeight < 1 || i === endLine && this.lineHeight > 1) lineHeight /= this.lineHeight;
|
|
18111
18135
|
let drawStart = boundaries.left + lineOffset + boxStart, drawHeight = lineHeight, extraTop = 0;
|
|
18112
18136
|
const drawWidth = boxEnd - boxStart;
|
|
@@ -18274,7 +18298,7 @@ var Textbox = class Textbox extends IText {
|
|
|
18274
18298
|
*/
|
|
18275
18299
|
isEmptyStyles(lineIndex) {
|
|
18276
18300
|
if (!this.styles) return true;
|
|
18277
|
-
let offset = 0, nextLineIndex
|
|
18301
|
+
let offset = 0, nextLineIndex, nextOffset, shouldLimit = false;
|
|
18278
18302
|
const map = this._styleMap[lineIndex], mapNextLine = this._styleMap[lineIndex + 1];
|
|
18279
18303
|
if (map) {
|
|
18280
18304
|
lineIndex = map.line;
|
|
@@ -18445,7 +18469,6 @@ var Textbox = class Textbox extends IText {
|
|
|
18445
18469
|
desiredWidth -= reservedSpace;
|
|
18446
18470
|
const maxWidth = Math.max(desiredWidth, largestWordWidth, this.dynamicMinWidth);
|
|
18447
18471
|
const data = wordsData[lineIndex];
|
|
18448
|
-
offset = 0;
|
|
18449
18472
|
let i;
|
|
18450
18473
|
for (i = 0; i < data.length; i++) {
|
|
18451
18474
|
const { word, width: wordWidth } = data[i];
|
|
@@ -19589,8 +19612,6 @@ function applyViewboxTransform(element) {
|
|
|
19589
19612
|
const viewBoxAttr = element.getAttribute("viewBox");
|
|
19590
19613
|
let scaleX = 1;
|
|
19591
19614
|
let scaleY = 1;
|
|
19592
|
-
let minX = 0;
|
|
19593
|
-
let minY = 0;
|
|
19594
19615
|
let matrix;
|
|
19595
19616
|
let el;
|
|
19596
19617
|
const widthAttr = element.getAttribute("width");
|
|
@@ -19625,8 +19646,8 @@ function applyViewboxTransform(element) {
|
|
|
19625
19646
|
return parsedDim;
|
|
19626
19647
|
}
|
|
19627
19648
|
const pasedViewBox = viewBoxAttr.match(reViewBoxAttrValue);
|
|
19628
|
-
minX = -parseFloat(pasedViewBox[1]);
|
|
19629
|
-
minY = -parseFloat(pasedViewBox[2]);
|
|
19649
|
+
const minX = -parseFloat(pasedViewBox[1]);
|
|
19650
|
+
const minY = -parseFloat(pasedViewBox[2]);
|
|
19630
19651
|
const viewBoxWidth = parseFloat(pasedViewBox[3]);
|
|
19631
19652
|
const viewBoxHeight = parseFloat(pasedViewBox[4]);
|
|
19632
19653
|
parsedDim.minX = minX;
|
|
@@ -22457,7 +22478,7 @@ var Resize = class extends BaseFilter {
|
|
|
22457
22478
|
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;
|
|
22458
22479
|
for (let j = 0; j < dH; j++) for (let i = 0; i < dW; i++) {
|
|
22459
22480
|
const x2 = (i + j * dW) * 4;
|
|
22460
|
-
let weight
|
|
22481
|
+
let weight;
|
|
22461
22482
|
let weights = 0;
|
|
22462
22483
|
let weightsAlpha = 0;
|
|
22463
22484
|
let gxR = 0;
|