Skip to content
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

Merged
merged 2 commits into from Aug 7, 2020

Conversation

yjbanov
Copy link
Contributor

@yjbanov yjbanov commented Aug 6, 2020

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

@yjbanov yjbanov changed the title fixed clipped and transformed content in HTML clip fix clipped and transformed content in HTML clip Aug 6, 2020
@yjbanov yjbanov requested a review from ferhatb August 6, 2020 21:05
@@ -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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove write:false

Copy link
Contributor Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@yjbanov yjbanov merged commit 0809f21 into flutter:master Aug 7, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 8, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 8, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants