mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-21 00:46:57 +01:00
Don't justify line if it has link in it.
This commit is contained in:
parent
e209b79519
commit
2d2d59a1de
1 changed files with 7 additions and 3 deletions
|
|
@ -460,7 +460,13 @@ def justify(self):
|
|||
self.current_width = self.line_length
|
||||
|
||||
def finalize(self, baselineskip, linespace, vdebug):
|
||||
if self.current_width >= 0.85 * self.line_length:
|
||||
if self.current_link is not None:
|
||||
self.end_link()
|
||||
|
||||
# We justify is line is small and it doesn't have links in it
|
||||
# If it has links, justification would cause the boundingrect of the link to
|
||||
# be too small
|
||||
if self.current_width >= 0.85 * self.line_length and len(self.links) == 0:
|
||||
self.justify()
|
||||
|
||||
self.width = float(self.current_width)
|
||||
|
|
@ -470,8 +476,6 @@ def finalize(self, baselineskip, linespace, vdebug):
|
|||
|
||||
self.vdebug = vdebug
|
||||
|
||||
if self.current_link is not None:
|
||||
self.end_link()
|
||||
for link in self.links:
|
||||
Link(self, *link)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue