From e70cdef7a5a21eda34f5f90260f9fd26099d274e Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Sun, 3 Sep 2023 12:20:46 +0200 Subject: fix css, dont throw when screenCtm fails (fixes #968) --- spec/spec/types/Matrix.js | 5 +++++ spec/spec/utils/utils.js | 17 ----------------- 2 files changed, 5 insertions(+), 17 deletions(-) (limited to 'spec') diff --git a/spec/spec/types/Matrix.js b/spec/spec/types/Matrix.js index f395c43..36882a9 100644 --- a/spec/spec/types/Matrix.js +++ b/spec/spec/types/Matrix.js @@ -594,6 +594,11 @@ describe('Matrix.js', () => { svg.screenCTM() expect(spy).toHaveBeenCalled() }) + + it('does not throw and returns identity matrix if element is not rendered', () => { + const canvas = SVG().viewbox(0, 0, 0, 0) + expect(canvas.screenCTM()).toEqual(new Matrix()) + }) }) }) }) diff --git a/spec/spec/utils/utils.js b/spec/spec/utils/utils.js index 0b3015e..314c757 100644 --- a/spec/spec/utils/utils.js +++ b/spec/spec/utils/utils.js @@ -5,7 +5,6 @@ import { filter, radians, degrees, - camelCase, unCamelCase, capitalize, proportionalSize, @@ -81,22 +80,6 @@ describe('utils.js', function () { }) }) - describe('camelCase()', function () { - it('converts dash-case and PascalCase to camelCase', function () { - var dash1 = 'dash-1' - var dashTwo = 'dash-two' - var camelOne = 'camelOne' - var pascalOne = 'PascalOne' - var mixOne = 'mix-One' - - expect(camelCase(dash1)).toBe('dash1') - expect(camelCase(dashTwo)).toBe('dashTwo') - expect(camelCase(camelOne)).toBe('camelone') - expect(camelCase(pascalOne)).toBe('pascalone') - expect(camelCase(mixOne)).toBe('mixOne') - }) - }) - describe('unCamelCase()', function () { it('converts camelCase to dash-case', function () { var dash1 = 'dash-1' -- cgit v1.2.3