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

Ensure when calculating font metrics that the total line height matches requested line height. #9668

Merged
merged 1 commit into from Feb 18, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -1928,9 +1928,14 @@ impl InlineMetrics {
#[inline]
pub fn from_font_metrics(font_metrics: &FontMetrics, line_height: Au) -> InlineMetrics {
let leading = line_height - (font_metrics.ascent + font_metrics.descent);
// Calculating the half leading here and then using leading - half_leading
// below ensure that we don't introduce any rounding accuracy issues here.
// The invariant is that the resulting total line height must exactly
// equal the requested line_height.
let half_leading = leading.scale_by(0.5);
InlineMetrics {
block_size_above_baseline: font_metrics.ascent + leading.scale_by(0.5),
depth_below_baseline: font_metrics.descent + leading.scale_by(0.5),
block_size_above_baseline: font_metrics.ascent + half_leading,
depth_below_baseline: font_metrics.descent + leading - half_leading,
ascent: font_metrics.ascent,
}
}

This file was deleted.

@@ -1,3 +1,5 @@
[transform-input-018.htm]
type: reftest
expected: FAIL
expected:
if os == "mac": PASS
FAIL
@@ -1,3 +1,5 @@
[position-relative-035.htm]
type: reftest
expected: FAIL
expected:
if os == "linux": PASS
FAIL
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.