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.
This commit is contained in:
asturur 2014-07-17 07:44:03 +02:00
parent d34f970ffb
commit 0bb156f308

View file

@ -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;