From 0bb156f30889e2947c25af5a44558188f18154a5 Mon Sep 17 00:00:00 2001 From: asturur Date: Thu, 17 Jul 2014 07:44:03 +0200 Subject: [PATCH] Update misc.js it had some problem with len of string 0 and slicing from 0 to -0 , or calculating len of ''. now is ok, rects went crazy and i didn't notice. --- src/util/misc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/misc.js b/src/util/misc.js index 31b9cf32..0a01d60c 100644 --- a/src/util/misc.js +++ b/src/util/misc.js @@ -135,7 +135,7 @@ parseUnit: function(value) { var unit = /\D{0,2}$/.exec(value), - number = parseFloat(value.slice(0, -unit[0].length)); + number = parseFloat(value.slice(0, unit.index)); switch (unit[0]) { case 'mm': return number * fabric.DPI / 25.4;