Skip to content

Commit

Permalink
Fix computing line height for generic boxes and images.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfeenst committed Jun 21, 2013
1 parent 5038924 commit 09a4ba8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/main/layout/inline.rs
Expand Up @@ -786,6 +786,10 @@ impl InlineFlowData {
let height = Au::from_px(size.get_or_default(Size2D(0, 0)).height);
image_box.base.position.size.height = height;

if height > linebox_height {
linebox_height = height;
}

image_box.base.position.translate(&Point2D(Au(0), -height))
}
TextRenderBoxClass(text_box) => {
Expand Down Expand Up @@ -822,6 +826,9 @@ impl InlineFlowData {
// and other replaced content.
// FIXME(pcwalton): This seems clownshoes; can we remove?
generic_box.position.size.height = Au::from_px(30);
if generic_box.position.size.height > linebox_height {
linebox_height = generic_box.position.size.height;
}
generic_box.position
}
// FIXME(pcwalton): This isn't very type safe!
Expand Down

5 comments on commit 09a4ba8

@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.

merging jrfeenst/servo/line-height3 = 09a4ba8 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.

jrfeenst/servo/line-height3 = 09a4ba8 merged ok, testing candidate = eb1e023

@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 = eb1e023

Please sign in to comment.