mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-19 02:51:07 +00:00
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:
parent
d34f970ffb
commit
0bb156f308
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue