From c99d13178b19e84510dba39acbd94836c740c587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= <juerg@scratchdisk.com> Date: Fri, 1 Nov 2013 19:25:41 +0100 Subject: [PATCH] Consider a Point or Size null if one of the components is null. --- src/svg/SVGImport.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/svg/SVGImport.js b/src/svg/SVGImport.js index 3f772000..f0787d21 100644 --- a/src/svg/SVGImport.js +++ b/src/svg/SVGImport.js @@ -43,15 +43,15 @@ new function() { function getPoint(node, x, y, allowNull) { x = getValue(node, x, false, allowNull); y = getValue(node, y, false, allowNull); - return allowNull && x == null && y == null ? null - : new Point(x || 0, y || 0); + return allowNull && (x == null || y == null) ? null + : new Point(x, y); } function getSize(node, w, h, allowNull) { w = getValue(node, w, false, allowNull); h = getValue(node, h, false, allowNull); - return allowNull && w == null && h == null ? null - : new Size(w || 0, h || 0); + return allowNull && (w == null || h == null) ? null + : new Size(w, h); } // Converts a string attribute value to the specified type