diff options
author | Dimitris Triantafyllidis <dtr@localhost.localdomain> | 2021-02-22 13:32:07 +0200 |
---|---|---|
committer | Tudor Brindus <me@tbrindus.ca> | 2021-02-22 21:23:35 -0500 |
commit | aac1582ea90897a25408a520b8f3bde0552a69cc (patch) | |
tree | 1d65c61f6287ba1be3a03d3f492d17ae5b046cd0 /sway/desktop/output.c | |
parent | view: Set parent for view_child subsurfaces on init (diff) | |
download | sway-aac1582ea90897a25408a520b8f3bde0552a69cc.tar.gz sway-aac1582ea90897a25408a520b8f3bde0552a69cc.tar.zst sway-aac1582ea90897a25408a520b8f3bde0552a69cc.zip |
Currently, various floating-point expressions involving
the coordinates of borders, titlebars and content surfaces
are directly assigned to integers, and so they are rounded
towards zero.
This results in off-by-one distances between these elements
when the signs of their coordinates differ.
Fixed by wrapping these expressions with a call to
floor before the assignment.
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 691a285d..7871a136 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -105,8 +105,8 @@ static bool get_surface_box(struct surface_iterator_data *data, | |||
105 | data->rotation); | 105 | data->rotation); |
106 | 106 | ||
107 | struct wlr_box box = { | 107 | struct wlr_box box = { |
108 | .x = data->ox + _sx, | 108 | .x = floor(data->ox + _sx), |
109 | .y = data->oy + _sy, | 109 | .y = floor(data->oy + _sy), |
110 | .width = sw, | 110 | .width = sw, |
111 | .height = sh, | 111 | .height = sh, |
112 | }; | 112 | }; |