From 881be4967dc6abd743784370d4b04d43118d82ac Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 3 Apr 2018 12:39:44 -0700 Subject: [PATCH] Fix TypeScript build errors --- demo/client/src/svg-loader.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/demo/client/src/svg-loader.ts b/demo/client/src/svg-loader.ts index 0a12be71..a813d1b8 100644 --- a/demo/client/src/svg-loader.ts +++ b/demo/client/src/svg-loader.ts @@ -69,15 +69,15 @@ export class SVGStroke extends SVGPath { super(element, 'stroke'); const style = window.getComputedStyle(element); - const ctm = element.getCTM(); + const ctm = unwrapNull(element.getCTM()); const strokeWidthString = unwrapNull(style.strokeWidth); const matches = /^(\d+\.?\d*)(.*)$/.exec(strokeWidthString); - let strokeWidth; + let strokeWidth: number; if (matches == null) { strokeWidth = 0.0; } else { - strokeWidth = parseFloat(matches[1]); + strokeWidth = unwrapNull(parseFloat(matches[1])); if (matches[2] === 'px') strokeWidth *= lerp(ctm.a, ctm.d, 0.5); } @@ -167,7 +167,7 @@ export class SVGLoader { for (const instance of this.pathInstances) { const element = instance.element; - const svgCTM = element.getCTM(); + const svgCTM = unwrapNull(element.getCTM()); const ctm = glmatrix.mat2d.fromValues(svgCTM.a, -svgCTM.b, svgCTM.c, -svgCTM.d, svgCTM.e, viewBox.height - svgCTM.f);