Apply transforms to text and fix multiple issues, such as circle/ellipse transforms with gradient fills - #74
Open
erikvullings wants to merge 3 commits into
Open
Apply transforms to text and fix multiple issues, such as circle/ellipse transforms with gradient fills#74erikvullings wants to merge 3 commits into
erikvullings wants to merge 3 commits into
Conversation
added 3 commits
January 4, 2026 13:43
This commit introduces a number of improvements and bug fixes to the applytransforms extension. Features: - Apply transformations to text and tspan elements, including font size scaling. - Improved handling of circles and ellipses, with warnings only for complex transformations. - Basic handling for clipPath and linearGradient elements. Fixes: - Corrected the scaling logic for rectangles. - Improved stroke width scaling to handle both style and direct attributes. - Fixed a ValueError in the scaleMultiple function. - Added tests for the new functionality and updated the test suite.
This commit fixes critical bugs where circles and ellipses with transforms were becoming invisible or lost during transformation, especially when using gradient fills. Changes: - Fixed type errors: All coordinate (cx, cy) and radius (r, rx, ry) values are now properly converted to strings as required by SVG specification - Circle to ellipse conversion: Circles with non-uniform scaling are now correctly converted to ellipses with proper rx/ry attributes - Automatic gradient transformation: Implemented proper transformation of radial and linear gradients with userSpaceOnUse coordinates: * Added transformGradient() method to detect and transform gradient refs * Added transformRadialGradient() to transform cx, cy, fx, fy, r coords * Added transformLinearGradient() to transform x1, y1, x2, y2 coords * Gradients now follow their shapes during transformation * Existing gradientTransform attributes are properly applied * CSS style attribute checked first (correct precedence over fill attr) - Added test case for circles with gradient fills in groups - Updated README with detailed changelog Fixes issue where shapes with gradient fills would appear at wrong positions or become invisible after applying transforms. Co-authored-by: Claude (Anthropic)
jackestar
added a commit
to jackestar/inkscape-applytransforms
that referenced
this pull request
Mar 29, 2026
added hypothesis to the dev requirements removed unneeded test run_test.py (the result dont match with inkscape anyway) from PR Klowner#74 restore original test and removed additional test (don't work) from PR Klowner#74
jackestar
added a commit
to jackestar/inkscape-applytransforms
that referenced
this pull request
Mar 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PR description I created explains:
Features:
scaling.
complex transformations.
Fixes:
attributes.
All the code is ready and tested. The circles with gradient fills now work correctly!