diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2021-06-13 22:39:18 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2021-06-13 22:39:18 +0200 |
commit | 34062cfa7731ab0c0d1df94b931fede0c57f1f09 (patch) | |
tree | 25048be424b0d78708c4dc026696e090379c4252 /src/modules | |
parent | 530f3755991149827974c1ecfa0ca046e9b653b8 (diff) | |
download | svg.js-34062cfa7731ab0c0d1df94b931fede0c57f1f09.tar.gz svg.js-34062cfa7731ab0c0d1df94b931fede0c57f1f09.zip |
fix group move bug when group contains elements without dimensions, update deps
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/core/containerGeometry.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/core/containerGeometry.js b/src/modules/core/containerGeometry.js index 50342b8..908bb27 100644 --- a/src/modules/core/containerGeometry.js +++ b/src/modules/core/containerGeometry.js @@ -4,8 +4,18 @@ import { proportionalSize } from '../../utils/utils.js' export function dmove (dx, dy) { this.children().forEach((child, i) => { - // Get the childs bbox - const bbox = child.bbox() + + let bbox + + // We have to wrap this for elements that dont have a bbox + // e.g. title and other descriptive elements + try { + // Get the childs bbox + bbox = child.bbox() + } catch (e) { + return + } + // Get childs matrix const m = new Matrix(child) // Translate childs matrix by amount and |