Skip to content

feat!: Remove integralSize property from class Svg, enforcing 'always true' behaviour#3969

Open
adario wants to merge 1 commit into
flame-engine:mainfrom
adario:feat/integral-sized-svg
Open

feat!: Remove integralSize property from class Svg, enforcing 'always true' behaviour#3969
adario wants to merge 1 commit into
flame-engine:mainfrom
adario:feat/integral-sized-svg

Conversation

@adario

@adario adario commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

The Svg.integralSize property was added in PR #3956: when true, it ensures that the keys for Svg._imageCache are always integer-sized. The property, however, would never be useful with its current default of false, since this would re-introduce floating-point rounding errors in the image cache keys.

Resolution

Remove the integralSize property, always following its true codepath.

Testing

An updated testbed for the changes is available — this displays 200+1 SvgComponent objects, all with different rotation/scale values; it now features the Svg button, which cycles through a few SVG assets.
For comparison purposes, the testbed starts with the default implementation; the Mode and Size buttons cycle through several combinations of the fixedRatio and cacheSize properties..

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Migration instructions

This PR does change the internal caching behaviour in class Svg, for all rendering operations. However, any existing use cases of class Svg should build as previously , since the property changes from PR #3956 haven't been published yet. All parameters/properties from PR #3956 have default values, so no build should break.
At runtime, the PR should not break class Svg clients either: the actual Image objects in the MemoryCache should maintain the previous dimensions and contents, since these were already integral prior to PR #3956. A 3-way comparison for the melos test --scope=flame_svg results reveals no differences (all tests fail in the same way)...

I apologise if I've missed something, but at present I wouldn't know what migration steps to provide.

Related Issues

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.

1 participant