1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 08:27:22 +03:00

Revert "Fix tests for Pango 1.44"

This reverts commit d6da699f91.
This commit is contained in:
Guillaume Ayoub 2019-08-14 18:34:42 +02:00
parent d6da699f91
commit cd925bc76c

View File

@ -1085,10 +1085,9 @@ def aligned_subtree_verticality(box, top_bottom_subtrees, baseline_y):
# Account for the line box itself: # Account for the line box itself:
top = baseline_y - box.baseline top = baseline_y - box.baseline
bottom = top + box.margin_height() bottom = top + box.margin_height()
# Ignore differences smaller than 0.5 to work around Pango roundings if min_y is None or top < min_y:
if min_y is None or min_y - top > 0.5:
min_y = top min_y = top
if max_y is None or bottom - max_y > 0.5: if max_y is None or bottom > max_y:
max_y = bottom max_y = bottom
return max_y, min_y return max_y, min_y
@ -1156,18 +1155,17 @@ def inline_box_verticality(box, top_bottom_subtrees, baseline_y):
top_bottom_subtrees.append(child) top_bottom_subtrees.append(child)
continue continue
# Ignore differences smaller than 0.5 to work around Pango roundings
bottom = top + child.margin_height() bottom = top + child.margin_height()
if min_y is None or min_y - top > 0.5: if min_y is None or top < min_y:
min_y = top min_y = top
if max_y is None or bottom - max_y > 0.5: if max_y is None or bottom > max_y:
max_y = bottom max_y = bottom
if isinstance(child, boxes.InlineBox): if isinstance(child, boxes.InlineBox):
children_max_y, children_min_y = inline_box_verticality( children_max_y, children_min_y = inline_box_verticality(
child, top_bottom_subtrees, child_baseline_y) child, top_bottom_subtrees, child_baseline_y)
if children_min_y is not None and min_y - children_min_y > 0.5: if children_min_y is not None and children_min_y < min_y:
min_y = children_min_y min_y = children_min_y
if children_max_y is not None and children_max_y - max_y > 0.5: if children_max_y is not None and children_max_y > max_y:
max_y = children_max_y max_y = children_max_y
return max_y, min_y return max_y, min_y