You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DecorationImage.centerSlice (and probably Canvas.drawImageNine) don't work correctly on web #130612
Specifically I was testing with a 4x4 image giving centerSlice: const Rect.fromLTWH(2.0, 2.0, 1.0, 1.0) to DecorationImage and the result did not match other platforms (nor my intuition and understanding of 9-patch image transforms).
I tried to verify this based on the given info and using below code sample with a test png (4x4), but observed below error in the console:
The following assertion was thrown during paint():
Assertion failed:
file:///Users/dhs/Documents/Fluttersdk/flutter/packages/flutter/lib/src/painting/decoration_image.dart:521:12
sourceSize == inputSize
"centerSlice was used with a BoxFit that does not guarantee that the image is fully visible."
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
darshankawar commentedon Jul 17, 2023
I tried to verify this based on the given info and using below code sample with a test png (4x4), but observed below error in the console:
runnable code sample
Also, maybe related : #16098
Hixie commentedon Jul 17, 2023
Yeah you'll need
fit: BoxFit.fillor similar. This was filed based on the test in https://github.com/flutter/flutter/blob/0398f28f9577d3afda85b8f02f10ba7f053fadef/packages/flutter/test/painting/decoration_image_lerp_test.dart (which hasn't landed yet).[web] Unskip DecorationImage.lerp tests on web
[web] Unskip decoration image lerp tests (flutter#191426)
Revert: [web] Unskip decoration image lerp tests (flutter#191462)
github-actions commentedon Sep 3, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.