Skip to content

Commit

Permalink
[IFC][Subpixel] Do not use integral FontMetrics APIs in RenderInline:…
Browse files Browse the repository at this point in the history
…:baselinePosition

https://bugs.webkit.org/show_bug.cgi?id=270421

Reviewed by Antti Koivisto.

This is in preparation for removing integral (vertical) pixel snapping.

* Source/WebCore/rendering/RenderInline.cpp:
(WebCore::RenderInline::baselinePosition const):

Canonical link: https://commits.webkit.org/275623@main
  • Loading branch information
alanbaradlay committed Mar 4, 2024
1 parent 2d02de5 commit 68ca286
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/WebCore/rendering/RenderInline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,9 +891,9 @@ LayoutUnit RenderInline::lineHeight(bool firstLine, LineDirectionMode /*directio

LayoutUnit RenderInline::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
{
const RenderStyle& style = firstLine ? firstLineStyle() : this->style();
const FontMetrics& fontMetrics = style.metricsOfPrimaryFont();
return LayoutUnit { (fontMetrics.intAscent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.intHeight()) / 2).toInt() };
auto& style = firstLine ? firstLineStyle() : this->style();
auto& fontMetrics = style.metricsOfPrimaryFont();
return LayoutUnit { fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2 };
}

LayoutSize RenderInline::offsetForInFlowPositionedInline(const RenderBox* child) const
Expand Down

0 comments on commit 68ca286

Please sign in to comment.