Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@eyebrowsoffire
Copy link
Contributor

@eyebrowsoffire eyebrowsoffire commented Feb 28, 2024

This fixes flutter/flutter#141001
This also fixes flutter/flutter#143743

  • We need to always call setStrutEnabled(true) on StrutStyle.
  • getLineMetricsAt had reversed ternary logic.
  • We also need to apply the rounding hack in Skwasm.
  • Ported unit tests from CanvasKit over to UI to cover Skwasm and HTML
  • The HTML renderer should return 0 line metrics for an empty paragraph.

This fixes flutter/flutter#141001
This also fixes flutter/flutter#143743

* We need to always call `setStrutEnabled(true)` on `StrutStyle`.
* `getLineMetricsAt` had reversed ternary logic.
* Ported unit tests from CanvasKit over to UI to cover Skwasm and HTML
* The HTML renderer should return 0 line metrics for an empty paragraph.
@github-actions github-actions bot added the platform-web Code specifically for the web engine label Feb 28, 2024
Copy link
Contributor

@mdebbar mdebbar left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +750 to +752
if (ui.ParagraphBuilder.shouldDisableRoundingHack) {
paragraphStyleSetApplyRoundingHack(handle, false);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure I understand this. Why not:

Suggested change
if (ui.ParagraphBuilder.shouldDisableRoundingHack) {
paragraphStyleSetApplyRoundingHack(handle, false);
}
paragraphStyleSetApplyRoundingHack(
handle,
!ui.ParagraphBuilder.shouldDisableRoundingHack,
);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because there is no reason to invoke this API when shoudlDisableRoundingHack is false, since the rounding hack is true by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

Worth putting a comment above this code?

@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #51074 at sha d5466ed

@eyebrowsoffire eyebrowsoffire added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 29, 2024
@auto-submit auto-submit bot merged commit e4a0b79 into flutter:main Feb 29, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine will affect goldens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Material3 app compiled with dart2wasm doesn't render text in search box [skwasm] Text input decorations and text are often invisible

2 participants