Fixing background rectangle sizes for Flutter
Bug: skia:10982 Change-Id: Id5b352c1139293195ca421b069e8632079acf37b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337181 Commit-Queue: Julia Lavrova <jlavrova@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Jason Simmons <jsimmons@google.com>
This commit is contained in:
parent
8d09d4ace9
commit
36d06a806f
@ -166,6 +166,12 @@ SkRect TextLine::paint(SkCanvas* textCanvas, SkScalar x, SkScalar y) {
|
||||
}
|
||||
|
||||
if (fHasBackground) {
|
||||
// TODO: Flutter only change
|
||||
// Background boxes should ignore line height and height multiplier
|
||||
auto ascentStyle = this->fAscentStyle;
|
||||
auto descentStyle = this->fDescentStyle;
|
||||
this->fAscentStyle = LineMetricStyle::Typographic;
|
||||
this->fDescentStyle = LineMetricStyle::Typographic;
|
||||
this->iterateThroughVisualRuns(false,
|
||||
[textCanvas, x, y, this]
|
||||
(const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) {
|
||||
@ -176,6 +182,8 @@ SkRect TextLine::paint(SkCanvas* textCanvas, SkScalar x, SkScalar y) {
|
||||
});
|
||||
return true;
|
||||
});
|
||||
this->fAscentStyle = ascentStyle;
|
||||
this->fDescentStyle = descentStyle;
|
||||
}
|
||||
|
||||
if (fHasShadows) {
|
||||
|
Loading…
Reference in New Issue
Block a user