diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-02 13:44:24 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-02 13:44:24 +0200 |
| commit | 57f27f7cc6a232827a774c3f36035d9290f3b6ce (patch) | |
| tree | 4d2fd98b9a989888c77016550c66470dd6679069 /src/cursor.zig | |
| parent | 26a5aaca69fecbf818d247fc7d838d7482431f20 (diff) | |
| download | river-57f27f7cc6a232827a774c3f36035d9290f3b6ce.tar.gz river-57f27f7cc6a232827a774c3f36035d9290f3b6ce.tar.xz | |
Implement tag assignment
There are a few bugs with this, but the core logic is sound
Diffstat (limited to 'src/cursor.zig')
| -rw-r--r-- | src/cursor.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cursor.zig b/src/cursor.zig index 37c2b07..e867a17 100644 --- a/src/cursor.zig +++ b/src/cursor.zig @@ -98,8 +98,8 @@ pub const Cursor = struct { // Move the grabbed view to the new position. // TODO: log on null if (self.grabbed_view) |view| { - view.current_state.x = @floatToInt(c_int, self.wlr_cursor.x - self.grab_x); - view.current_state.y = @floatToInt(c_int, self.wlr_cursor.y - self.grab_y); + view.current_box.x = @floatToInt(c_int, self.wlr_cursor.x - self.grab_x); + view.current_box.y = @floatToInt(c_int, self.wlr_cursor.y - self.grab_y); } } @@ -119,8 +119,8 @@ pub const Cursor = struct { const dx: f64 = self.wlr_cursor.x - self.grab_x; const dy: f64 = self.wlr_cursor.y - self.grab_y; - var x: f64 = @intToFloat(f64, view.current_state.x); - var y: f64 = @intToFloat(f64, view.current_state.y); + var x: f64 = @intToFloat(f64, view.current_box.x); + var y: f64 = @intToFloat(f64, view.current_box.y); var width = @intToFloat(f64, self.grab_width); var height = @intToFloat(f64, self.grab_height); @@ -143,8 +143,8 @@ pub const Cursor = struct { } else if (self.resize_edges & @intCast(u32, c.WLR_EDGE_RIGHT) != 0) { width += dx; } - view.current_state.x = @floatToInt(c_int, x); - view.current_state.y = @floatToInt(c_int, y); + view.current_box.x = @floatToInt(c_int, x); + view.current_box.y = @floatToInt(c_int, y); _ = c.wlr_xdg_toplevel_set_size( view.wlr_xdg_surface, @floatToInt(u32, width), |
