mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
parent
71f8aca66b
commit
d1e16c5030
1 changed files with 2 additions and 2 deletions
|
|
@ -152,8 +152,8 @@ view_compute_centered_position(struct view *view, int w, int h, int *x, int *y)
|
||||||
struct wlr_box usable = output_usable_area_in_layout_coords(output);
|
struct wlr_box usable = output_usable_area_in_layout_coords(output);
|
||||||
int width = w + view->margin.left + view->margin.right;
|
int width = w + view->margin.left + view->margin.right;
|
||||||
int height = h + view->margin.top + view->margin.bottom;
|
int height = h + view->margin.top + view->margin.bottom;
|
||||||
*x = usable.x + usable.width / wlr_output->scale / 2 - width / 2;
|
*x = usable.x + (usable.width - width) / 2;
|
||||||
*y = usable.y + usable.height / wlr_output->scale / 2 - height / 2;
|
*y = usable.y + (usable.height - height) / 2;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue