mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Conversion pipeline: Handle elements with percentage sizes that are children of zero size parents correctly. Fixes #6155 (error converting epub to mobi)
This commit is contained in:
parent
ed5b45164b
commit
9825a47254
@ -475,7 +475,8 @@ class Style(object):
|
|||||||
value = float(m.group(1))
|
value = float(m.group(1))
|
||||||
unit = m.group(2)
|
unit = m.group(2)
|
||||||
if unit == '%':
|
if unit == '%':
|
||||||
base = base or self.width
|
if base is None:
|
||||||
|
base = self.width
|
||||||
result = (value / 100.0) * base
|
result = (value / 100.0) * base
|
||||||
elif unit == 'px':
|
elif unit == 'px':
|
||||||
result = value * 72.0 / self._profile.dpi
|
result = value * 72.0 / self._profile.dpi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user