diff --git a/js/kiri-driver-laser.js b/js/kiri-driver-laser.js index 7e185257..31a2997a 100644 --- a/js/kiri-driver-laser.js +++ b/js/kiri-driver-laser.js @@ -186,8 +186,8 @@ var gs_kiri_laser = exports; }); }); - // normalize against origin lower left if (!process.outputOriginCenter) { + // normalize against origin lower left output.forEach(function(layer) { layer.forEach(function(out) { point = out.point; @@ -199,6 +199,21 @@ var gs_kiri_laser = exports; max.y = max.y - min.y; min.x = 0; min.y = 0; + } else { + // normalize against center of build area + let w = print.settings.device.bedWidth; + let h = print.settings.device.bedDepth; + output.forEach(function(layer) { + layer.forEach(function(out) { + point = out.point; + point.x += w/2; + point.y += h/2; + }); + }); + max.x = w; + max.y = h; + min.x = 0; + min.y = 0; } onpre(min, max, process.outputLaserPower, process.outputLaserSpeed); diff --git a/js/license.js b/js/license.js index 2b4421b1..3fd2111d 100644 --- a/js/license.js +++ b/js/license.js @@ -1,7 +1,7 @@ var exports = { COPYRIGHT:"Copyright (C) 2014-2019 Stewart Allen - All Rights Reserved", LICENSE:"See the license.md file included with the source distribution", - VERSION:"1.4.2" + VERSION:"1.4.3" }; if (!module) var module = {}; module.exports = exports;