From 9825a47254914562e80c06102ff109a13a75ab2f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 17 Jul 2010 17:56:14 -0600 Subject: [PATCH] Conversion pipeline: Handle elements with percentage sizes that are children of zero size parents correctly. Fixes #6155 (error converting epub to mobi) --- src/calibre/ebooks/oeb/stylizer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index 4789899fbf..f465935376 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -475,7 +475,8 @@ class Style(object): value = float(m.group(1)) unit = m.group(2) if unit == '%': - base = base or self.width + if base is None: + base = self.width result = (value / 100.0) * base elif unit == 'px': result = value * 72.0 / self._profile.dpi