mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-10-21 14:49:51 -04:00
FXL: don't use book viewport if it's empty
Fixes https://github.com/johnfactotum/foliate-js/issues/52#issuecomment-2956113877
This commit is contained in:
1 parent
4ee127d88f
commit
b26cde2527
1 file changed
+1
-1
+1
-1
@@ -18,7 +18,7 @@ const getViewport = (doc, viewport) => {
|
||||
|
||||
// fallback to book's viewport
|
||||
if (typeof viewport === 'string') return parseViewport(viewport)
|
||||
if (viewport) return viewport
|
||||
if (viewport?.width && viewport.height) return viewport
|
||||
|
||||
// if no viewport (possibly with image directly in spine), get image size
|
||||
const img = doc.querySelector('img')
|
||||
|
||||
Reference in new issue
Block a user