From 08d7f1f1761bfacea0556cd5f344f0b55be83c06 Mon Sep 17 00:00:00 2001 From: Squibid Date: Sat, 22 Nov 2025 20:46:57 -0500 Subject: [PATCH] default view moving shouldn't clamp to the visible area --- src/cursor.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cursor.zig b/src/cursor.zig index 2309ce2..44c8bc9 100644 --- a/src/cursor.zig +++ b/src/cursor.zig @@ -89,8 +89,11 @@ pub fn processCursorMotion(self: *Cursor, time_msec: u32) void { if(focused_view) |view| { view.scene_tree.node.setPosition( - std.math.clamp(@as(c_int, @intFromFloat(self.wlr_cursor.x)) - self.drag_view_offset_x, 0, std.math.maxInt(u32)), - std.math.clamp(@as(c_int, @intFromFloat(self.wlr_cursor.y)) - self.drag_view_offset_y, 0, std.math.maxInt(u32)) + // TODO: add a lua option to configure the behavior of this, by + // default it will be the following: + @as(c_int, @intFromFloat(self.wlr_cursor.x)) - self.drag_view_offset_x, + @as(c_int, @intFromFloat(self.wlr_cursor.y)) - self.drag_view_offset_y + // and the user should be able to configure if it clamps or not ); } },