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 TextStyle.lerp() to properly interpolate text shadows #145666

Merged
merged 3 commits into from Apr 3, 2024

Conversation

leoafarias
Copy link
Contributor

@leoafarias leoafarias commented Mar 24, 2024

Currently, TextStyle.lerp() does not properly interpolate the shadows property between two TextStyle instances. This PR addresses the issue by using ui.Shadow.lerpList() to interpolate the shadow lists, ensuring that the individual shadow properties (blur radius, color, and offset) are correctly lerped.

The changes include:

  • Updating the TextStyle.lerp() method to use ui.Shadow.lerpList() for the shadows property.
  • Adding a new test case in text_style_test.dart to verify the correct interpolation of text shadows.

Here is a snippet showing the comparison, when using ui.Shadow.lerpList()
https://dartpad.dev/?id=799c4bec8b791b74580193174759b93d

Closes #145665

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. labels Mar 24, 2024
@leoafarias leoafarias marked this pull request as ready for review March 24, 2024 22:25
Copy link
Contributor

@Renzo-Olivares Renzo-Olivares left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the fix and the test!

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

Nice fix, thanks!

@gspencergoog gspencergoog added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 3, 2024
@auto-submit auto-submit bot merged commit 2759ec2 into flutter:master Apr 3, 2024
67 checks passed
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Apr 4, 2024
flutter/flutter@e868e2b...ac2ca93

2024-04-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from aadf522e3c98 to 4303dc0d7a73 (1 revision) (flutter/flutter#146262)
2024-04-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from c57c8665b4eb to aadf522e3c98 (1 revision) (flutter/flutter#146261)
2024-04-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from ca7596642cfd to c57c8665b4eb (1 revision) (flutter/flutter#146259)
2024-04-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from 83c037c449b5 to ca7596642cfd (1 revision) (flutter/flutter#146258)
2024-04-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from 614154012e93 to 83c037c449b5 (1 revision) (flutter/flutter#146255)
2024-04-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from 41da00ac46bc to 614154012e93 (1 revision) (flutter/flutter#146250)
2024-04-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from 18fdcad40332 to 41da00ac46bc (6 revisions) (flutter/flutter#146246)
2024-04-04 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#146245)
2024-04-03 sokolovskyi.konstantin@gmail.com Add tests for theme_extension.1.dart API example. (flutter/flutter#145819)
2024-04-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 349608d2b008 to 18fdcad40332 (6 revisions) (flutter/flutter#146240)
2024-04-03 kallentu@google.com Add `missing_code_block_language_in_doc_comment` lint. (flutter/flutter#145354)
2024-04-03 ian@hixie.ch Magnifier cleanup (flutter/flutter#143558)
2024-04-03 34871572+gmackall@users.noreply.github.com Set up Kotlin linting step in ci with ktlint (flutter/flutter#143478)
2024-04-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1a9e48ab1c9a to 349608d2b008 (1 revision) (flutter/flutter#146230)
2024-04-03 54558023+keyonghan@users.noreply.github.com Update ownership to GitHub handles (flutter/flutter#146221)
2024-04-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from d065763b1a63 to 1a9e48ab1c9a (1 revision) (flutter/flutter#146226)
2024-04-03 103135467+sealesj@users.noreply.github.com Refactor fuchsia_precache (flutter/flutter#145978)
2024-04-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from b1c23addaec5 to d065763b1a63 (1 revision) (flutter/flutter#146218)
2024-04-03 31859944+LongCatIsLooong@users.noreply.github.com `computeDryBaseline` for rendering / widgets RenderBoxes (flutter/flutter#146143)
2024-04-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 7b28ae1d15cb to b1c23addaec5 (1 revision) (flutter/flutter#146214)
2024-04-03 leoafarias@gmail.com Fix TextStyle.lerp() to properly interpolate text shadows (flutter/flutter#145666)
2024-04-03 31859944+LongCatIsLooong@users.noreply.github.com Renderflex cross intrinsic size with baseline alignment (flutter/flutter#146185)
2024-04-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 56fa2c33a5f7 to 7b28ae1d15cb (1 revision) (flutter/flutter#146208)
2024-04-03 103135467+sealesj@users.noreply.github.com Refactor customer_testing (flutter/flutter#145911)
2024-04-03 tessertaha@gmail.com Add `DropdownMenu` cursor behavior sample (flutter/flutter#146133)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextStyle.lerp() does not properly interpolate text shadows
4 participants