mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Conversion pipeline: Fix bug that caused height/width specified in %/em of screen size to be incorrectly calculated by a factor of 72./DPI
This commit is contained in:
parent
113ff417d6
commit
b343837f65
@ -37,6 +37,8 @@ class Plugin(_Plugin):
|
|||||||
self.fsizes.append((name, num, float(size)))
|
self.fsizes.append((name, num, float(size)))
|
||||||
self.fnames = dict((name, sz) for name, _, sz in self.fsizes if name)
|
self.fnames = dict((name, sz) for name, _, sz in self.fsizes if name)
|
||||||
self.fnums = dict((num, sz) for _, num, sz in self.fsizes if num)
|
self.fnums = dict((num, sz) for _, num, sz in self.fsizes if num)
|
||||||
|
self.width_pts = self.width * 72./self.dpi
|
||||||
|
self.height_pts = self.height * 72./self.dpi
|
||||||
|
|
||||||
# Input profiles {{{
|
# Input profiles {{{
|
||||||
class InputProfile(Plugin):
|
class InputProfile(Plugin):
|
||||||
|
@ -575,7 +575,7 @@ class Style(object):
|
|||||||
if parent is not None:
|
if parent is not None:
|
||||||
base = parent.width
|
base = parent.width
|
||||||
else:
|
else:
|
||||||
base = self._profile.width
|
base = self._profile.width_pts
|
||||||
if 'width' in self._element.attrib:
|
if 'width' in self._element.attrib:
|
||||||
width = self._element.attrib['width']
|
width = self._element.attrib['width']
|
||||||
elif 'width' in self._style:
|
elif 'width' in self._style:
|
||||||
@ -605,7 +605,7 @@ class Style(object):
|
|||||||
if parent is not None:
|
if parent is not None:
|
||||||
base = parent.height
|
base = parent.height
|
||||||
else:
|
else:
|
||||||
base = self._profile.height
|
base = self._profile.height_pts
|
||||||
if 'height' in self._element.attrib:
|
if 'height' in self._element.attrib:
|
||||||
height = self._element.attrib['height']
|
height = self._element.attrib['height']
|
||||||
elif 'height' in self._style:
|
elif 'height' in self._style:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user