Commit 18490bcb authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[LayoutNG] Use integer-version of ascent/descent

This patch changes ascent and descent from LayoutUnit to
integer, so that the use is consistent.

In future, we'll want to switch to LayoutUnit, but
inconsitent use is likely to be a source of problems
than to help the migration.

Bug: 636993
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I81bb766eaf4579b50bbe1896e48018b3aea81c20
Reviewed-on: https://chromium-review.googlesource.com/1075909
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575939}
parent b1033f68
......@@ -25,8 +25,10 @@ NGLineHeightMetrics::NGLineHeightMetrics(const FontMetrics& font_metrics,
void NGLineHeightMetrics::Initialize(const FontMetrics& font_metrics,
FontBaseline baseline_type) {
ascent = font_metrics.FixedAscent(baseline_type);
descent = font_metrics.FixedDescent(baseline_type);
// TODO(kojii): In future, we'd like to use LayoutUnit metrics to support
// sub-CSS-pixel layout.
ascent = LayoutUnit(font_metrics.Ascent(baseline_type));
descent = LayoutUnit(font_metrics.Descent(baseline_type));
}
void NGLineHeightMetrics::AddLeading(LayoutUnit line_height) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment