mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Revert #572
This commit is contained in:
parent
44e08bbdff
commit
0e18d26960
@ -1248,10 +1248,11 @@ class HTMLConverter(object):
|
||||
except ValueError:
|
||||
pass
|
||||
m = re.search(r"\s*(-*[0-9]*\.?[0-9]*)\s*(%|em|px|mm|cm|in|dpt|pt|pc)", val)
|
||||
normal = self.unit_convert(base_length)
|
||||
|
||||
if m is not None and m.group(1):
|
||||
unit = float(m.group(1))
|
||||
if m.group(2) == '%':
|
||||
if m.group(2) == '%':
|
||||
normal = self.unit_convert(base_length)
|
||||
result = (unit/100.0) * normal
|
||||
elif m.group(2) == 'px':
|
||||
result = unit
|
||||
@ -1262,6 +1263,7 @@ class HTMLConverter(object):
|
||||
elif m.group(2) == 'dpt':
|
||||
result = unit * dpi/720.
|
||||
elif m.group(2) == 'em':
|
||||
normal = self.unit_convert(base_length)
|
||||
result = unit * normal
|
||||
elif m.group(2) == 'pc':
|
||||
result = unit * (dpi/72.) * 12
|
||||
|
Loading…
x
Reference in New Issue
Block a user