mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Fix the vertical alignment error for img tag.
This commit is contained in:
parent
10b1e655b0
commit
e96f02718a
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue