mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Fix very slow loading for HTML files with very many images on Linux. Fixes #1774884 [loading flow for some ebooks takes painfully long in linux](https://bugs.launchpad.net/calibre/+bug/1774884)
For some reason setting column break inside on the images was causing a re-layout only on Linux.
This commit is contained in:
parent
13f9a4b7c9
commit
1cbd6ccf9b
Binary file not shown.
@ -348,11 +348,16 @@ class PagedDisplay
|
||||
# force a relayout if the render tree is dirty.
|
||||
images = []
|
||||
vimages = []
|
||||
bounding_rects = []
|
||||
img_tags = document.getElementsByTagName('img')
|
||||
for img in img_tags
|
||||
bounding_rects.push(img.getBoundingClientRect())
|
||||
maxh = this.current_page_height
|
||||
for img in document.getElementsByTagName('img')
|
||||
for i in [0...img_tags.length]
|
||||
img = img_tags[i]
|
||||
previously_limited = calibre_utils.retrieve(img, 'width-limited', false)
|
||||
data = calibre_utils.retrieve(img, 'img-data', null)
|
||||
br = img.getBoundingClientRect()
|
||||
br = bounding_rects[i]
|
||||
if data == null
|
||||
data = {'left':br.left, 'right':br.right, 'height':br.height, 'display': img.style.display}
|
||||
calibre_utils.store(img, 'img-data', data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user