Simplify jsPDF switch

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2801 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Brett Zamir 2014-04-09 01:13:05 +00:00
parent 35ab5a9862
commit 1b5e55dc5c
1 changed files with 8 additions and 24 deletions

View File

@ -991,30 +991,14 @@ PubSub implementation
};
switch (unit) {
case 'pt':
k = 1;
break;
case 'mm':
k = 72 / 25.4;
break;
case 'cm':
k = 72 / 2.54;
break;
case 'in':
k = 72;
break;
case 'px':
k = 96 / 72;
break;
case 'pc':
k = 12;
break;
case 'em':
k = 12;
break;
case 'ex':
k = 6;
break;
case 'pt': k = 1; break;
case 'mm': k = 72 / 25.4; break;
case 'cm': k = 72 / 2.54; break;
case 'in': k = 72; break;
case 'px': k = 96 / 72; break;
case 'pc': k = 12; break;
case 'em': k = 12; break;
case 'ex': k = 6; break;
default:
throw ('Invalid unit: ' + unit);
}