diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/utils.mjs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils.mjs b/src/utils.mjs index 3eb57bb..eeedb81 100644 --- a/src/utils.mjs +++ b/src/utils.mjs | |||
| @@ -37,8 +37,8 @@ export const animateRectTransition = (element, rect, options = {}) => { | |||
| 37 | const { width: w1, height: h1, left: x1, top: y1 } = rect | 37 | const { width: w1, height: h1, left: x1, top: y1 } = rect |
| 38 | const { width: w2, height: h2, left: x2, top: y2 } = element.getBoundingClientRect() | 38 | const { width: w2, height: h2, left: x2, top: y2 } = element.getBoundingClientRect() |
| 39 | 39 | ||
| 40 | const rw = w1 / w2 | 40 | const rw = (w1 ?? w2) / w2 |
| 41 | const rh = h1 / h2 | 41 | const rh = (h1 ?? h2) / h2 |
| 42 | const dx = x1 - x2; | 42 | const dx = x1 - x2; |
| 43 | const dy = y1 - y2; | 43 | const dy = y1 - y2; |
| 44 | 44 | ||