mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Don't justify line if it has link in it.
This commit is contained in:
parent
e209b79519
commit
2d2d59a1de
@ -460,7 +460,13 @@ class Line(QGraphicsItem):
|
||||
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 @@ class Line(QGraphicsItem):
|
||||
|
||||
self.vdebug = vdebug
|
||||
|
||||
if self.current_link is not None:
|
||||
self.end_link()
|
||||
for link in self.links:
|
||||
Link(self, *link)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user