From cf48e8c36ed5a89c541597e32b1c21e2d74342f2 Mon Sep 17 00:00:00 2001 From: Travis Evans Date: Wed, 30 Apr 2025 19:29:24 -0500 Subject: [PATCH] Make format menu arrows easier to tap --- apps/tevtimer/app.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/tevtimer/app.js b/apps/tevtimer/app.js index 1e31ffef0..6ec98f72c 100644 --- a/apps/tevtimer/app.js +++ b/apps/tevtimer/app.js @@ -524,11 +524,16 @@ class TimerFormatView { // Touch handler function touchHandler(button, xy) { // Increment or decrement row's format index based on the arrow tapped + + // Enlarge tap area by this amount in the X direction to make it + // easier to hit + const x_tolerance = 20; + for (let row_id of ROW_IDS) { for (let btn_id of ['prev', 'next']) { let elem = row_id + '.' + btn_id; - if (xy.x >= this.layout[elem].x - && xy.x <= this.layout[elem].x + this.layout[elem].w + if (xy.x >= this.layout[elem].x - x_tolerance + && xy.x <= this.layout[elem].x + this.layout[elem].w + x_tolerance && xy.y >= this.layout[elem].y && xy.y <= this.layout[elem].y + this.layout[elem].h) { if (btn_id === 'prev') {