diff options
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/desktop.c | 9 | ||||
-rw-r--r-- | rootston/output.c | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c index a724a40c..f87be11e 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -167,15 +167,14 @@ struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly, continue; } - int scale = view->wlr_surface->current->scale; - double view_sx = (lx - view->x) / (double)scale; - double view_sy = (ly - view->y) / (double)scale; + double view_sx = lx - view->x; + double view_sy = ly - view->y; struct wlr_box box = { .x = 0, .y = 0, - .width = view->wlr_surface->current->buffer_width * scale, - .height = view->wlr_surface->current->buffer_height * scale, + .width = view->wlr_surface->current->buffer_width, + .height = view->wlr_surface->current->buffer_height, }; if (view->rotation != 0.0) { // Coordinates relative to the center of the view diff --git a/rootston/output.c b/rootston/output.c index 37af1e2d..c21c6781 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -25,6 +25,8 @@ static void render_surface(struct wlr_surface *surface, int height = surface->current->buffer_height * scale_factor; double ox = lx, oy = ly; wlr_output_layout_output_coords(desktop->layout, wlr_output, &ox, &oy); + ox *= wlr_output->scale; + oy *= wlr_output->scale; if (wlr_output_layout_intersects(desktop->layout, wlr_output, lx, ly, lx + width, ly + height)) { |