]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Use output_usable_area_scaled() helper
authorAxel Burri <axel@tty0.ch>
Sat, 5 Aug 2023 21:53:01 +0000 (23:53 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Thu, 19 Oct 2023 18:09:42 +0000 (19:09 +0100)
src/view.c

index f38ab369d22c61881097e42074d84be0398a4c39..f6a20e2461cbdbd1a9783f17a1207d128767e4a1 100644 (file)
@@ -208,16 +208,7 @@ static struct wlr_box
 view_get_edge_snap_box(struct view *view, struct output *output,
                enum view_edge edge)
 {
-       struct wlr_box usable = output_usable_area_in_layout_coords(output);
-       if (usable.height == output->wlr_output->height
-                       && output->wlr_output->scale != 1) {
-               usable.height /= output->wlr_output->scale;
-       }
-       if (usable.width == output->wlr_output->width
-                       && output->wlr_output->scale != 1) {
-               usable.width /= output->wlr_output->scale;
-       }
-
+       struct wlr_box usable = output_usable_area_scaled(output);
        int x_offset = edge == VIEW_EDGE_RIGHT
                ? (usable.width + rc.gap) / 2 : rc.gap;
        int y_offset = edge == VIEW_EDGE_DOWN