Skip to content

Commit

Permalink
Fix the vertical alignment error for img tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
june0cho committed Jun 5, 2014
1 parent 10b1e65 commit e96f027
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/main/layout/inline.rs
Expand Up @@ -985,7 +985,11 @@ impl InlineFlow {
vertical_align::middle => {
// TODO: x-height value should be used from font info.
let xheight = Au(0);
(-(xheight + fragment.content_height()).scale_by(0.5), false)
let fragment_height = fragment.content_height();
let offset_top = -(xheight + fragment_height).scale_by(0.5);
*height_above_baseline = offset_top.scale_by(-1.0);
*depth_below_baseline = fragment_height - *height_above_baseline;
(offset_top, false)
},
vertical_align::sub => {
// TODO: The proper position for subscripts should be used. Lower the baseline to
Expand Down

5 comments on commit e96f027

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from SimonSapin
at june0cho@e96f027

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging june0cho/servo/fix_vertical_align = e96f027 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

june0cho/servo/fix_vertical_align = e96f027 merged ok, testing candidate = d293b46

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = d293b46

Please sign in to comment.