Fix fit to content (#841)

* Fix: avoid to select defs or title as parentElement

* Fix: fix problem when nothing is drawing
master
cg-scorpio 2022-10-16 15:43:58 +02:00 committed by GitHub
parent aabd593123
commit cb2fe733dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 7 deletions

View File

@ -974,6 +974,7 @@ export const getVisibleElements = (parentElement) => {
}
const contentElems = []
if (parentElement) {
const children = parentElement.children
// eslint-disable-next-line array-callback-return
Array.from(children, (elem) => {
@ -981,6 +982,7 @@ export const getVisibleElements = (parentElement) => {
contentElems.push(elem)
}
})
}
return contentElems.reverse()
}