When editing text inside a group element, the text cursor was appearing
in the wrong position because only the text element's own transform was
being considered, ignoring transforms from parent groups.
This change:
- Adds a new #getAccumulatedMatrix() method that traverses up the DOM tree
from the text element to the SVG content element, collecting and multiplying
all transform matrices along the way
- Updates the init() method to use this accumulated matrix instead of just
the text element's transform
- Updates test mock to include getSvgContent() method
Fixes the issue where editing text inside a transformed group would show
the cursor at the wrong position.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Update svgWhiteList in sanitize.js to include 'font-stretch' for relevant SVG elements
* Refactor svgWhiteList in sanitize.js to utilize FONT_ATTRIBUTES for better maintainability and consistency across SVG elements
* Update history.js
- Change `BatchCommand.unapply` to use `[...this.commands].reverse()` so the original array is never mutated.
- This preserves the order of commands and ensures history integrity.
* update and adapt code to latest dependencies
-> need testIsolation to False with the latest Cypress
* need this for CI (bug https://github.com/npm/cli/issues/4828)
* run instrument before test
* fix test
* v7.3.4
* fix: Enhance text properties for multiple selected elements (SVG-Edit/svgedit#918)
This commit addresses issue SVG-Edit/svgedit#918 by improving
text property handling when multiple elements are selected.
You can now set Bold, Italic, Text-Decoration, Text-Anchor,
Letter-Spacing, Word-Spacing, Text Length, and Length Adjust.
* Update Editor.js
---------
Co-authored-by: JFH <20402845+jfhenon@users.noreply.github.com>
* Fix: securize convertToGroup method when manipulate element with no transform attribute
* Fix: securise getIntersectionListMethod method when manipulate element with no bbox (for example : defs element)
* Fix: securise resize method when there is no bbox (for example : defs element)
* Fix: securise recalculateDimensions to avoid to pass null to addSubCommand
* Enhancement: add a parameter to the importSvgString function in order to permit to decide if the importation should apply a transformation on the imported element or not
* allow user to import SVG preserving the dimension
Co-authored-by: JFH <20402845+jfhenon@users.noreply.github.com>
* Fix: applies the transformation of the parent element in addition to that of the selected element
* Fix: delete debug logs and use a ternary operator
now you can use directlt svgcanvas. see readme.md
* configure workspaces
* move svgcanvas to packages folder
* move utils to common and paint to svgcanvas
* make svgcanvas a dependency of svgedit
* update deps
* workspaces requires npm 7 at least so the ci needs a new node version
* update github actions to V3
* update snapshots using custom svg exports
* remove unmaintained cypress snapshot plugin
* new github action to add coverage in PR
* Update onpushandpullrequest.yml
* svgcanvas v7.1.6