summaryrefslogtreecommitdiff
path: root/src/esp32p4.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/esp32p4.zig')
-rw-r--r--src/esp32p4.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/esp32p4.zig b/src/esp32p4.zig
index 4e1fe036..6772e75d 100644
--- a/src/esp32p4.zig
+++ b/src/esp32p4.zig
@@ -455,8 +455,9 @@ fn apply(c: *pardes.Pardes, ev: vaxis.Event) void {
.motion => .motion,
.drag => .drag,
},
- .col = @intCast(m.col),
- .row = @intCast(m.row),
+ // Before the first cell (a drag past the edge): the edge.
+ .col = @intCast(@max(0, m.col)),
+ .row = @intCast(@max(0, m.row)),
.ctrl = m.mods.ctrl,
} });
dirty = true;