diff --git a/apps/calibration/boot.js b/apps/calibration/boot.js index 2c60de26b..03b17a03a 100644 --- a/apps/calibration/boot.js +++ b/apps/calibration/boot.js @@ -9,6 +9,6 @@ Bangle.on('touch', function(button, xy) { } // apply the calibration offset - xy.x = Math.round((xy.x + cal_settings.xoffset) * cal_settings.xscale); - xy.y = Math.round((xy.y + cal_settings.yoffset) * cal_settings.yscale); + xy.x = E.clip(Math.round((xy.x + (cal_settings.xoffset || 0)) * (cal_settings.xscale || 1)),0,g.getWidth()); + xy.y = E.clip(Math.round((xy.y + (cal_settings.yoffset || 0)) * (cal_settings.yscale || 1)),0,g.getHeight()); });