DOCX: Fix narrow double borders not rendering

This commit is contained in:
Kovid Goyal 2013-06-06 09:34:35 +05:30
parent 59c6ec11b1
commit a6e4a9bef9

View File

@ -87,9 +87,12 @@ def read_single_border(parent, edge):
if sz is not None: if sz is not None:
# we dont care about art borders (they are only used for page borders) # we dont care about art borders (they are only used for page borders)
try: try:
width = min(96, max(2, float(sz))) / 8 # WebKit needs at least 1pt to render borders
width = min(96, max(8, float(sz))) / 8
except (ValueError, TypeError): except (ValueError, TypeError):
pass pass
if style == 'double' and width is not None and 0 < width < 3:
width = 3 # WebKit needs 3pts to render double borders
return {p:v for p, v in zip(border_props, (padding, width, style, color))} return {p:v for p, v in zip(border_props, (padding, width, style, color))}
def read_border(parent, dest, border_edges=('left', 'top', 'right', 'bottom'), name='pBdr'): def read_border(parent, dest, border_edges=('left', 'top', 'right', 'bottom'), name='pBdr'):