]> git.mdlowis.com Git - proto/labwc.git/commitdiff
common/box: drop box_contains()
authortokyo4j <hrak1529@gmail.com>
Wed, 21 May 2025 11:43:17 +0000 (20:43 +0900)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 21 May 2025 11:55:59 +0000 (13:55 +0200)
include/common/box.h
src/common/box.c
src/view.c

index 6dc2fe3e973e08b456709c680c484cefc1cd3830..3d900a0eec4cc0bf3bb6a3b4526502c31171ed3c 100644 (file)
@@ -4,8 +4,6 @@
 
 #include <wlr/util/box.h>
 
-bool box_contains(struct wlr_box *box_super, struct wlr_box *box_sub);
-
 bool box_intersects(struct wlr_box *box_a, struct wlr_box *box_b);
 
 /* Returns the bounding box of 2 boxes */
index a6316d16ca59fa6677a6c8fc8948ed8b3b46123d..0b1c0b445b8a4d8958c3975093f2536bd2d61618 100644 (file)
@@ -3,18 +3,6 @@
 #include "common/box.h"
 #include "common/macros.h"
 
-bool
-box_contains(struct wlr_box *box_super, struct wlr_box *box_sub)
-{
-       if (wlr_box_empty(box_super) || wlr_box_empty(box_sub)) {
-               return false;
-       }
-       return box_super->x <= box_sub->x
-               && box_super->x + box_super->width >= box_sub->x + box_sub->width
-               && box_super->y <= box_sub->y
-               && box_super->y + box_super->height >= box_sub->y + box_sub->height;
-}
-
 bool
 box_intersects(struct wlr_box *box_a, struct wlr_box *box_b)
 {
index 2b01cce8a15442787b3cc9b71a5274870fb1eb1d..c520a947de8a97f7a373f0ef22703d3426e869a9 100644 (file)
@@ -1050,12 +1050,12 @@ view_cascade(struct view *view)
                         * top-left corner is not covered by other views,
                         * shift the candidate to bottom-right.
                         */
-                       if (box_contains(&candidate, &other)
+                       if (wlr_box_contains_box(&candidate, &other)
                                        && !wlr_box_contains_point(
                                                &covered, other.x, other.y)) {
                                candidate.x = other.x + offset_x;
                                candidate.y = other.y + offset_y;
-                               if (!box_contains(&usable, &candidate)) {
+                               if (!wlr_box_contains_box(&usable, &candidate)) {
                                        /*
                                         * If the candidate doesn't fit within
                                         * the usable area, fall back to center