From 2c76ae4ebd8c901157e99914b48a55cf26e93a6b Mon Sep 17 00:00:00 2001 From: make-ing Date: Thu, 17 Sep 2015 15:22:27 +0200 Subject: [PATCH] fixed scale calculation bug --- src/octoprint/plugins/svgtogcode/static/js/working_area.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/plugins/svgtogcode/static/js/working_area.js b/src/octoprint/plugins/svgtogcode/static/js/working_area.js index c98486d7..88c82cc5 100644 --- a/src/octoprint/plugins/svgtogcode/static/js/working_area.js +++ b/src/octoprint/plugins/svgtogcode/static/js/working_area.js @@ -317,7 +317,7 @@ $(function(){ var endIdx = transform.local.indexOf(',', startIdx); var rot = parseFloat(transform.local.substring(startIdx, endIdx)) || 0; // if(!rot) rot = 0; // avoid NaN - var scale = Math.pow(transform.localMatrix.a,2) + Math.pow(transform.localMatrix.b,2) * 100; + var scale = (Math.pow(transform.localMatrix.a,2) + Math.pow(transform.localMatrix.b,2)) * 100; var id = svg.attr('id'); var label_id = id.substr(0, id.indexOf('-')); $('#'+label_id+' .translation').text(tx.toFixed(1) + ',' + ty.toFixed(1));