mirror of https://github.com/espruino/BangleApps
Clip values to display range
parent
cddaf36f1a
commit
f763cd962f
|
@ -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());
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue