mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-12-19 03:13:19 +00:00
fix crash when borders align perfectly with screen borders
This commit is contained in:
parent
88f241d1cf
commit
d53e1b2676
4
dwl.c
4
dwl.c
@ -1878,8 +1878,8 @@ run(char *startup_cmd)
|
|||||||
void
|
void
|
||||||
scalebox(struct wlr_box *box, float scale)
|
scalebox(struct wlr_box *box, float scale)
|
||||||
{
|
{
|
||||||
box->width = ROUND((box->x + box->width) * scale) - ROUND(box->x * scale);
|
box->width = MAX(1, ROUND((box->x + box->width) * scale) - ROUND(box->x * scale));
|
||||||
box->height = ROUND((box->y + box->height) * scale) - ROUND(box->y * scale);
|
box->height = MAX(1, ROUND((box->y + box->height) * scale) - ROUND(box->y * scale));
|
||||||
box->x = ROUND(box->x * scale);
|
box->x = ROUND(box->x * scale);
|
||||||
box->y = ROUND(box->y * scale);
|
box->y = ROUND(box->y * scale);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user