New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix clipped and transformed content in HTML clip #20310
Conversation
@@ -23,7 +23,7 @@ void main() async { | |||
// Commit a recording canvas to a bitmap, and compare with the expected | |||
Future<void> _checkScreenshot(RecordingCanvas rc, String fileName, | |||
{Rect region = const Rect.fromLTWH(0, 0, 500, 500), | |||
double maxDiffRatePercent = 0.0}) async { | |||
double maxDiffRatePercent = 0.0, bool write = false}) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove write:false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been useful the last few times I added new screenshot tests, but I can remove it if adds noise.
@@ -35,7 +35,7 @@ void main() async { | |||
sceneElement.append(engineCanvas.rootElement); | |||
html.document.body.append(sceneElement); | |||
await matchGoldenFile('$fileName.png', | |||
region: region, maxDiffRatePercent: maxDiffRatePercent); | |||
region: region, maxDiffRatePercent: maxDiffRatePercent, write: write); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Description
Apply
transform-origin: 0 0 0
to the clipping element. Otherwise, we get wrong transform on the clipped content.Related Issues
Fixes flutter/flutter#61691
Tests
I added the following tests:
Added a new test in
canvas_draw_image_golden_test.dart
, which reproduces this issue.This change requires a new golden: flutter/goldens#103