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

Align text at baseline #488

Merged
merged 2 commits into from May 28, 2013
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Merge with TextRenderBox refactor

  • Loading branch information
Eric Atkinson
Eric Atkinson committed May 28, 2013
commit 1fd9a8f162ec1066526fe461bd0cb30c47d713e0
@@ -841,7 +841,7 @@ impl InlineFlowData {
let halfleading = match cur_box {
TextRenderBoxClass(text_box) => {
//ad is the AD height as defined by CSS 2.1 § 10.8.1
let ad = text_box.text_data.run.font.metrics.ascent + text_box.text_data.run.font.metrics.descent;
let ad = text_box.run.font.metrics.ascent + text_box.run.font.metrics.descent;
(line_height - ad).scale_by(0.5)
},
_ => Au(0),
@@ -852,7 +852,7 @@ impl InlineFlowData {
let halfleading = Au::max(halfleading, Au(0));

let height = match cur_box {
TextRenderBoxClass(text_box) => text_box.text_data.run.font.metrics.ascent,
TextRenderBoxClass(text_box) => text_box.run.font.metrics.ascent,
_ => cur_box.position().size.height
};

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.