From a6e4a9bef955ca8edca1ac9ddf9a5f2e80d60692 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 6 Jun 2013 09:34:35 +0530 Subject: [PATCH] DOCX: Fix narrow double borders not rendering --- src/calibre/ebooks/docx/block_styles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/docx/block_styles.py b/src/calibre/ebooks/docx/block_styles.py index b4533fbb80..12b3d28179 100644 --- a/src/calibre/ebooks/docx/block_styles.py +++ b/src/calibre/ebooks/docx/block_styles.py @@ -87,9 +87,12 @@ def read_single_border(parent, edge): if sz is not None: # we dont care about art borders (they are only used for page borders) 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): 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))} def read_border(parent, dest, border_edges=('left', 'top', 'right', 'bottom'), name='pBdr'):