2024-05-04 06:26:27 +09:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
|
#ifndef LABWC_BOX_H
|
|
|
|
|
#define LABWC_BOX_H
|
|
|
|
|
|
|
|
|
|
#include <wlr/util/box.h>
|
|
|
|
|
|
2024-10-05 09:45:48 -04:00
|
|
|
bool box_intersects(struct wlr_box *box_a, struct wlr_box *box_b);
|
2024-05-04 06:26:27 +09:00
|
|
|
|
|
|
|
|
/* Returns the bounding box of 2 boxes */
|
2024-10-05 09:45:48 -04:00
|
|
|
void box_union(struct wlr_box *box_dest, struct wlr_box *box_a,
|
|
|
|
|
struct wlr_box *box_b);
|
|
|
|
|
|
|
|
|
|
/*
|
2024-11-28 19:21:18 +09:00
|
|
|
* Fits and centers a content box (width & height) within a bounding box.
|
|
|
|
|
* The content box is downscaled if necessary (preserving aspect ratio) but
|
|
|
|
|
* not upscaled.
|
2024-10-05 09:45:48 -04:00
|
|
|
*
|
|
|
|
|
* The returned x & y coordinates are the centered content position
|
|
|
|
|
* relative to the top-left corner of the bounding box.
|
|
|
|
|
*/
|
2025-10-01 20:47:33 +01:00
|
|
|
struct wlr_box box_fit_within(int width, int height, struct wlr_box *bound);
|
2024-05-04 06:26:27 +09:00
|
|
|
|
2025-02-22 15:20:53 +09:00
|
|
|
struct wlr_fbox box_to_fbox(struct wlr_box *box);
|
|
|
|
|
|
2024-05-04 06:26:27 +09:00
|
|
|
#endif /* LABWC_BOX_H */
|