mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
FXL: fix getting viewport from SVGs
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ const parseViewport = str => str
|
|||||||
|
|
||||||
const getViewport = (doc, viewport) => {
|
const getViewport = (doc, viewport) => {
|
||||||
// use `viewBox` for SVG
|
// use `viewBox` for SVG
|
||||||
if (doc.documentElement.nodeName === 'svg') {
|
if (doc.documentElement.localName === 'svg') {
|
||||||
const [, , width, height] = doc.documentElement
|
const [, , width, height] = doc.documentElement
|
||||||
.getAttribute('viewBox')?.split(/\s/) ?? []
|
.getAttribute('viewBox')?.split(/\s/) ?? []
|
||||||
return { width, height }
|
return { width, height }
|
||||||
|
|||||||
Reference in New Issue
Block a user