Skip to content

fix: add proper handling of percentage lengths - #2756

Merged
jakex7 merged 4 commits into
software-mansion:mainfrom
kacperzolkiewski:invalidPercentageLengths
Sep 15, 2025
Merged

jakex7 merged 4 commits into
software-mansion:mainfrom
kacperzolkiewski:invalidPercentageLengths

Conversation

@kacperzolkiewski

Copy link
Copy Markdown
Collaborator

Summary

This PR fixes: #2330

  • Add calculating relative width based on viewBox width if length unit is percentage (relativeOnWidth function)
  • Add calculating relative height based on viewBox height if length unit is percentage (relativeOnHeight function

Test Plan

Run example from issue: #2330 and compare it with the SVG Viewer.
Run fabric-example and compare it with the example before that changes.

Compatibility

OS Implemented
iOS ✅
MacOS ✅
Android ✅
Web ✅

Checklist

  • I have tested this on a simulator

kacperzolkiewski and others added 2 commits September 15, 2025 13:34
Co-authored-by: Jakub Grzywacz <jaqbgrzy@gmail.com>
Co-authored-by: Jakub Grzywacz <jaqbgrzy@gmail.com>
Co-authored-by: Jakub Grzywacz <jaqbgrzy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid percentage lengths when viewbox ratio is different from width/height

2 participants