aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-09-30 13:54:51 +0200
committeremersion <contact@emersion.fr>2017-09-30 13:54:51 +0200
commit77d28183b53a9fc85efe4788f3a53f3077084f6b (patch)
treef759fc09d791428d040276a32b8aa24d10f1b472 /rootston
parent28d4b475dc74302653882e5f5f58506c5c16bcb6 (diff)
Partially fix resize offset
Diffstat (limited to 'rootston')
-rw-r--r--rootston/cursor.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c
index ac6b1dc3..bef30746 100644
--- a/rootston/cursor.c
+++ b/rootston/cursor.c
@@ -33,8 +33,10 @@ void view_begin_resize(struct roots_input *input, struct wlr_cursor *cursor,
struct roots_view *view, uint32_t edges) {
input->mode = ROOTS_CURSOR_RESIZE;
wlr_log(L_DEBUG, "begin resize");
- input->offs_x = cursor->x - view->x;
- input->offs_y = cursor->y - view->y;
+ input->offs_x = cursor->x;
+ input->offs_y = cursor->y;
+ input->view_x = view->x;
+ input->view_y = view->y;
input->view_width = view->wlr_surface->current.width;
input->view_height = view->wlr_surface->current.height;
input->resize_edges = edges;
@@ -71,14 +73,14 @@ void cursor_update_position(struct roots_input *input, uint32_t time) {
int width = input->view_width;
int height = input->view_height;
if (input->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_TOP) {
- input->active_view->y = dy;
+ input->active_view->y = input->view_y + dy;
height -= dy;
}
if (input->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_BOTTOM) {
height += dy;
}
if (input->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_LEFT) {
- input->active_view->x = dx;
+ input->active_view->x = input->view_x + dx;
width -= dx;
}
if (input->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_RIGHT) {