Take a slider let go within a centimetre of the glass edge as its end, because the panel loses a finger swiped off the screen before the slider's end (0.2.80)
A fast swipe off the right side of a Guition ended at 93-98 %: the GT911 reports the finger for the last time 33-48 px inside the edge while a wide tile's slider ends 29 px from it, and LVGL keeps the last point it saw. cyd::edge_snap() takes a release inside the band (SLIDER_EDGE_SNAP_PX: Guition 67, CYD 56) as the end that lies in that band, for the tile sliders and the light card's sliders; the log names each snap. App 0.2.80, firmware 0.2.67. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -168,4 +168,12 @@ int main() {
|
||||
assert(!cyd::release_jump(20, 0, 0, 360)); // dragged to the start and let go
|
||||
assert(!cyd::release_jump(240, 238, 0, 360)); // a few pixels on lift-off
|
||||
assert(cyd::release_jump(80, -6, -6, 100)); // brightness: 80 % to the stub below 1 %
|
||||
// A slider let go within the edge band of the glass meant the end that lies in that band.
|
||||
assert(cyd::edge_snap(437, 29, 450, 480, 67) == 1); // wide tile, a fast swipe the panel lost at 437
|
||||
assert(cyd::edge_snap(431, 29, 450, 480, 67) == 1);
|
||||
assert(cyd::edge_snap(412, 29, 450, 480, 67) == 0); // let go just before the band
|
||||
assert(cyd::edge_snap(437, 29, 222, 480, 67) == 0); // a narrow tile's end is far from the edge
|
||||
assert(cyd::edge_snap(20, 29, 450, 480, 67) == -1); // off the left: the start
|
||||
assert(cyd::edge_snap(20, 258, 452, 480, 67) == 0); // the right column's start is not in the band
|
||||
assert(cyd::edge_snap(437, 29, 450, 480, 0) == 0); // band off
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user