mirror of
https://github.com/Kozea/WeasyPrint.git
synced 2024-10-04 16:07:57 +03:00
Fix the available width for shrink-to-fit on absolutes.
This commit is contained in:
parent
773700dd73
commit
c8d6066ace
@ -117,7 +117,8 @@ def absolute_block(document, box, containing_block):
|
||||
box.margin_left = 0
|
||||
if margin_r == 'auto':
|
||||
box.margin_right = 0
|
||||
available_width = cb_width
|
||||
available_width = cb_width - (
|
||||
padding_plus_borders_x + box.margin_left + box.margin_right)
|
||||
box.width = shrink_to_fit(box, available_width)
|
||||
elif left != 'auto' and right != 'auto' and width != 'auto':
|
||||
width_for_margins = cb_width - (
|
||||
|
@ -21,6 +21,9 @@ from ..text import TextFragment
|
||||
def shrink_to_fit(box, available_width):
|
||||
"""Return the shrink-to-fit width of ``box``.
|
||||
|
||||
*Warning:* both available_outer_width and the return value are
|
||||
for width of the *content area*, not margin area.
|
||||
|
||||
http://www.w3.org/TR/CSS21/visudet.html#float-width
|
||||
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user