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

Fix the vertical alignment error for img tag. #2592

Merged
merged 1 commit into from Jun 5, 2014
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fix the vertical alignment error for img tag.

  • Loading branch information
june0cho committed Jun 5, 2014
commit e96f02718ae59754b1f9e3a1f9bb629475f38ea9
@@ -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
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.