mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
parent
82d36025e1
commit
9af0c5338f
11 changed files with 34 additions and 36 deletions
|
|
@ -31,8 +31,8 @@ bool wlr_box_empty(const struct wlr_box *box) {
|
|||
return box == NULL || box->width <= 0 || box->height <= 0;
|
||||
}
|
||||
|
||||
bool wlr_box_intersection(const struct wlr_box *box_a,
|
||||
const struct wlr_box *box_b, struct wlr_box *dest) {
|
||||
bool wlr_box_intersection(struct wlr_box *dest, const struct wlr_box *box_a,
|
||||
const struct wlr_box *box_b) {
|
||||
bool a_empty = wlr_box_empty(box_a);
|
||||
bool b_empty = wlr_box_empty(box_b);
|
||||
|
||||
|
|
@ -66,9 +66,8 @@ bool wlr_box_contains_point(const struct wlr_box *box, double x, double y) {
|
|||
}
|
||||
}
|
||||
|
||||
void wlr_box_transform(const struct wlr_box *box,
|
||||
enum wl_output_transform transform, int width, int height,
|
||||
struct wlr_box *dest) {
|
||||
void wlr_box_transform(struct wlr_box *dest, const struct wlr_box *box,
|
||||
enum wl_output_transform transform, int width, int height) {
|
||||
struct wlr_box src = *box;
|
||||
|
||||
if (transform % 2 == 0) {
|
||||
|
|
@ -115,8 +114,8 @@ void wlr_box_transform(const struct wlr_box *box,
|
|||
}
|
||||
}
|
||||
|
||||
void wlr_box_rotated_bounds(const struct wlr_box *box, float rotation,
|
||||
struct wlr_box *dest) {
|
||||
void wlr_box_rotated_bounds(struct wlr_box *dest, const struct wlr_box *box,
|
||||
float rotation) {
|
||||
if (rotation == 0) {
|
||||
*dest = *box;
|
||||
return;
|
||||
|
|
@ -144,7 +143,7 @@ void wlr_box_rotated_bounds(const struct wlr_box *box, float rotation,
|
|||
dest->height = ceil(fmax(y1, y2) - fmin(y1, y2));
|
||||
}
|
||||
|
||||
void wlr_box_from_pixman_box32(const pixman_box32_t box, struct wlr_box *dest) {
|
||||
void wlr_box_from_pixman_box32(struct wlr_box *dest, const pixman_box32_t box) {
|
||||
*dest = (struct wlr_box){
|
||||
.x = box.x1,
|
||||
.y = box.y1,
|
||||
|
|
|
|||
|
|
@ -545,7 +545,7 @@ static void output_scissor(struct wlr_output *output, pixman_box32_t *rect) {
|
|||
|
||||
enum wl_output_transform transform =
|
||||
wlr_output_transform_invert(output->transform);
|
||||
wlr_box_transform(&box, transform, ow, oh, &box);
|
||||
wlr_box_transform(&box, &box, transform, ow, oh);
|
||||
|
||||
wlr_renderer_scissor(renderer, &box);
|
||||
}
|
||||
|
|
@ -665,7 +665,7 @@ static void output_cursor_update_visible(struct wlr_output_cursor *cursor) {
|
|||
|
||||
struct wlr_box intersection;
|
||||
bool visible =
|
||||
wlr_box_intersection(&output_box, &cursor_box, &intersection);
|
||||
wlr_box_intersection(&intersection, &output_box, &cursor_box);
|
||||
|
||||
if (cursor->surface != NULL) {
|
||||
if (cursor->visible && !visible) {
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ bool wlr_output_layout_intersects(struct wlr_output_layout *layout,
|
|||
wl_list_for_each(l_output, &layout->outputs, link) {
|
||||
struct wlr_box *output_box =
|
||||
output_layout_output_get_box(l_output);
|
||||
if (wlr_box_intersection(output_box, target_lbox, &out_box)) {
|
||||
if (wlr_box_intersection(&out_box, output_box, target_lbox)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -269,7 +269,7 @@ bool wlr_output_layout_intersects(struct wlr_output_layout *layout,
|
|||
}
|
||||
|
||||
struct wlr_box *output_box = output_layout_output_get_box(l_output);
|
||||
return wlr_box_intersection(output_box, target_lbox, &out_box);
|
||||
return wlr_box_intersection(&out_box, output_box, target_lbox);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ static void capture_output(struct wl_client *client,
|
|||
|
||||
buffer_box = *box;
|
||||
|
||||
wlr_box_transform(&buffer_box, output->transform, ow, oh, &buffer_box);
|
||||
wlr_box_transform(&buffer_box, &buffer_box, output->transform, ow, oh);
|
||||
buffer_box.x *= output->scale;
|
||||
buffer_box.y *= output->scale;
|
||||
buffer_box.width *= output->scale;
|
||||
|
|
|
|||
|
|
@ -647,5 +647,5 @@ void wlr_xdg_surface_get_geometry(struct wlr_xdg_surface *surface,
|
|||
return;
|
||||
}
|
||||
|
||||
wlr_box_intersection(&surface->geometry, box, box);
|
||||
wlr_box_intersection(box, &surface->geometry, box);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -598,5 +598,5 @@ void wlr_xdg_surface_v6_get_geometry(struct wlr_xdg_surface_v6 *surface, struct
|
|||
return;
|
||||
}
|
||||
|
||||
wlr_box_intersection(&surface->geometry, box, box);
|
||||
wlr_box_intersection(box, &surface->geometry, box);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue