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

Conversation

@bleroux
Copy link
Contributor

@bleroux bleroux commented Jun 2, 2022

Description

This PR adds an assert to Canvas.drawParagraph to check that Paragraph.layout has been called.

Related Issue

Fixes flutter/flutter#97172

Tests

Adds 1 test.

@bleroux bleroux requested a review from dnfield June 2, 2022 09:32
@bleroux bleroux changed the base branch from main to master June 2, 2022 13:01
@flutter-dashboard
Copy link

This pull request was opened against a branch other than main. Since Flutter pull requests should not normally be opened against branches other than main, I have changed the base to main. If this was intended, you may modify the base back to master. See the Release Process for information about how other branches get updated.

Reviewers: Use caution before merging pull requests to branches other than main, unless this is an intentional hotfix/cherrypick.

@flutter-dashboard flutter-dashboard bot changed the base branch from master to main June 2, 2022 13:01
lib/ui/text.dart Outdated
void layout(ParagraphConstraints constraints) => _layout(constraints.width);
void layout(ParagraphConstraints constraints) {
_layout(constraints.width);
_needsLayout = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Guard this via an assertion

@bleroux bleroux requested a review from dnfield June 2, 2022 17:49
Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@dnfield dnfield added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jun 2, 2022
@fluttergithubbot fluttergithubbot merged commit 7d8f975 into flutter:main Jun 2, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 2, 2022
@TahaTesser TahaTesser deleted the fix_canvas_drawParagraph_should_assert branch June 3, 2022 08:26
houhuayong pushed a commit to houhuayong/engine that referenced this pull request Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Canvas.drawParagraph should assert that Paragraph.layout has been called

3 participants