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

[Impeller] Use the start/end tangent of contours to compute stroke contour cap normals #39124

Merged
merged 1 commit into from Jan 26, 2023

Conversation

bdero
Copy link
Member

@bdero bdero commented Jan 25, 2023

Resolves flutter/flutter#118945.

  • Instead of using the direction from/to the start/end points of the contour for a cap normal, use the curve's analytical start/end tangent for perfect results.
  • Append points to draw the Cap::kButt cap, since it may no longer align perfectly with the last line segment direction.
  • This also fixes similar slightly wrong results for closed path shapes such as ovals when using Cap::kButt.

Before:

Screen.Recording.2023-01-24.at.11.31.35.PM.mov

After:

Screen.Recording.2023-01-25.at.2.19.38.AM.mov

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@bdero bdero merged commit c068a36 into flutter:main Jan 26, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 26, 2023
zanderso pushed a commit to zanderso/engine that referenced this pull request Jan 26, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jan 26, 2023
…119218)

* c068a3675 [Impeller] Use analytical normals for stroke caps (flutter/engine#39124)

* 68912346c Roll Dart SDK from de14a48187ce to d9151e59f70b (6 revisions) (flutter/engine#39146)

* 285f3311b Roll Clang from a93d03310e2c to 20d06c833d83 (flutter/engine#39152)

* ab2ccd5a6 Roll Dart SDK from d9151e59f70b to f61211592196 (3 revisions) (flutter/engine#39154)

* 04f22beeb Roll Skia from 393fb1ec80f4 to 3d0e2ad41911 (6 revisions) (flutter/engine#39153)
XilaiZhang pushed a commit that referenced this pull request Jan 31, 2023
Co-authored-by: Brandon DeRosier <bdero@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
2 participants