mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Workaround the LRS spec having only a sidemargin attribute rather than individual margins.
This commit is contained in:
parent
50498fcc0e
commit
4d14a272c4
@ -1039,6 +1039,13 @@ class HTMLConverter(object):
|
||||
ans['footskip'] = set(self.book.defaultBlockStyle.attrs['footskip'], s1[2], s2[2])
|
||||
ans['sidemargin'] = set(self.book.defaultBlockStyle.attrs['sidemargin'], s1[3], s2[3])
|
||||
|
||||
if 2*int(ans['sidemargin']) >= 0.8*int(self.current_block.blockStyle.attrs['blockwidth']):
|
||||
val = int(ans['sidemargin'])
|
||||
ans['sidemargin'] = set(self.book.defaultBlockStyle.attrs['sidemargin'], s1[1], s2[1])
|
||||
val += int(ans['sidemargin'])
|
||||
val /= 2.
|
||||
ans['sidemargin'] = int(val)
|
||||
|
||||
return ans
|
||||
|
||||
def font_properties(self, css):
|
||||
|
Loading…
x
Reference in New Issue
Block a user