-
Notifications
You must be signed in to change notification settings - Fork 6k
libtxt: have GetRectsForRange(strut) fall back to tight bounds if layout isn't forcing use of the strut #9058
libtxt: have GetRectsForRange(strut) fall back to tight bounds if layout isn't forcing use of the strut #9058
Conversation
third_party/txt/src/txt/paragraph.cc
Outdated
| box.rect.fLeft, line_baselines_[kv.first] - strut_.ascent, | ||
| box.rect.fRight, line_baselines_[kv.first] + strut_.descent), | ||
| box.direction); | ||
| if (strut_.force_strut) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try paragraph_style_.strut_enabled && paragraph_style_.strut_font_size >= 0 as the condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this to use the same criteria as valid_strut in ComputeStrut
10df3b6 to
034ba19
Compare
| box.rect.fLeft, line_baselines_[kv.first] - strut_.ascent, | ||
| box.rect.fRight, line_baselines_[kv.first] + strut_.descent), | ||
| box.direction); | ||
| if (IsStrutValid()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you document this fallback behavior here as well as in the enum declaration?
|
Please add a test to verify that disabled strut returns tight bounds |
034ba19 to
e06c1df
Compare
…out isn't forcing use of the strut
e06c1df to
b9c7863
Compare
|
Done - PTAL |
GaryQian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…s if layout isn't forcing use of the strut (flutter/engine#9058)
…out isn't forcing use of the strut (flutter#9058)
No description provided.