diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-01 18:35:58 +1000 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-05-01 07:46:57 -0400 |
commit | ed9e2015b24617bddd6c43556094fba9865ae522 (patch) | |
tree | ace411ff97c0f10df710928d22d8f8c54c4040cc | |
parent | Fix surface offset when using borders (diff) | |
download | sway-ed9e2015b24617bddd6c43556094fba9865ae522.tar.gz sway-ed9e2015b24617bddd6c43556094fba9865ae522.tar.zst sway-ed9e2015b24617bddd6c43556094fba9865ae522.zip |
Scale borders according to output scale
-rw-r--r-- | sway/desktop/output.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 2511c610..498a3a2e 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -240,6 +240,7 @@ static void render_container_simple_border_normal(struct sway_output *output, | |||
240 | box.y = con->y + 1; | 240 | box.y = con->y + 1; |
241 | box.width = con->sway_view->border_thickness; | 241 | box.width = con->sway_view->border_thickness; |
242 | box.height = con->height - 1; | 242 | box.height = con->height - 1; |
243 | scale_box(&box, output->wlr_output->scale); | ||
243 | wlr_render_rect(renderer, &box, color, | 244 | wlr_render_rect(renderer, &box, color, |
244 | output->wlr_output->transform_matrix); | 245 | output->wlr_output->transform_matrix); |
245 | 246 | ||
@@ -248,6 +249,7 @@ static void render_container_simple_border_normal(struct sway_output *output, | |||
248 | box.y = con->y + 1; | 249 | box.y = con->y + 1; |
249 | box.width = con->sway_view->border_thickness; | 250 | box.width = con->sway_view->border_thickness; |
250 | box.height = con->height - 1; | 251 | box.height = con->height - 1; |
252 | scale_box(&box, output->wlr_output->scale); | ||
251 | wlr_render_rect(renderer, &box, color, | 253 | wlr_render_rect(renderer, &box, color, |
252 | output->wlr_output->transform_matrix); | 254 | output->wlr_output->transform_matrix); |
253 | 255 | ||
@@ -256,6 +258,7 @@ static void render_container_simple_border_normal(struct sway_output *output, | |||
256 | box.y = con->y + con->height - con->sway_view->border_thickness; | 258 | box.y = con->y + con->height - con->sway_view->border_thickness; |
257 | box.width = con->width; | 259 | box.width = con->width; |
258 | box.height = con->sway_view->border_thickness; | 260 | box.height = con->sway_view->border_thickness; |
261 | scale_box(&box, output->wlr_output->scale); | ||
259 | wlr_render_rect(renderer, &box, color, | 262 | wlr_render_rect(renderer, &box, color, |
260 | output->wlr_output->transform_matrix); | 263 | output->wlr_output->transform_matrix); |
261 | 264 | ||
@@ -265,6 +268,7 @@ static void render_container_simple_border_normal(struct sway_output *output, | |||
265 | box.y = con->y; | 268 | box.y = con->y; |
266 | box.width = con->width; | 269 | box.width = con->width; |
267 | box.height = 1; | 270 | box.height = 1; |
271 | scale_box(&box, output->wlr_output->scale); | ||
268 | wlr_render_rect(renderer, &box, color, | 272 | wlr_render_rect(renderer, &box, color, |
269 | output->wlr_output->transform_matrix); | 273 | output->wlr_output->transform_matrix); |
270 | 274 | ||
@@ -273,6 +277,7 @@ static void render_container_simple_border_normal(struct sway_output *output, | |||
273 | box.y = con->sway_view->y - 1; | 277 | box.y = con->sway_view->y - 1; |
274 | box.width = con->width - con->sway_view->border_thickness * 2; | 278 | box.width = con->width - con->sway_view->border_thickness * 2; |
275 | box.height = 1; | 279 | box.height = 1; |
280 | scale_box(&box, output->wlr_output->scale); | ||
276 | wlr_render_rect(renderer, &box, color, | 281 | wlr_render_rect(renderer, &box, color, |
277 | output->wlr_output->transform_matrix); | 282 | output->wlr_output->transform_matrix); |
278 | 283 | ||
@@ -282,6 +287,7 @@ static void render_container_simple_border_normal(struct sway_output *output, | |||
282 | box.y = con->y + 1; | 287 | box.y = con->y + 1; |
283 | box.width = con->width - con->sway_view->border_thickness * 2; | 288 | box.width = con->width - con->sway_view->border_thickness * 2; |
284 | box.height = con->sway_view->y - con->y - 2; | 289 | box.height = con->sway_view->y - con->y - 2; |
290 | scale_box(&box, output->wlr_output->scale); | ||
285 | wlr_render_rect(renderer, &box, color, | 291 | wlr_render_rect(renderer, &box, color, |
286 | output->wlr_output->transform_matrix); | 292 | output->wlr_output->transform_matrix); |
287 | 293 | ||
@@ -306,6 +312,7 @@ static void render_container_simple_border_pixel(struct sway_output *output, | |||
306 | box.y = con->y; | 312 | box.y = con->y; |
307 | box.width = con->sway_view->border_thickness; | 313 | box.width = con->sway_view->border_thickness; |
308 | box.height = con->height; | 314 | box.height = con->height; |
315 | scale_box(&box, output->wlr_output->scale); | ||
309 | wlr_render_rect(renderer, &box, color, | 316 | wlr_render_rect(renderer, &box, color, |
310 | output->wlr_output->transform_matrix); | 317 | output->wlr_output->transform_matrix); |
311 | 318 | ||
@@ -314,6 +321,7 @@ static void render_container_simple_border_pixel(struct sway_output *output, | |||
314 | box.y = con->y; | 321 | box.y = con->y; |
315 | box.width = con->sway_view->border_thickness; | 322 | box.width = con->sway_view->border_thickness; |
316 | box.height = con->height; | 323 | box.height = con->height; |
324 | scale_box(&box, output->wlr_output->scale); | ||
317 | wlr_render_rect(renderer, &box, color, | 325 | wlr_render_rect(renderer, &box, color, |
318 | output->wlr_output->transform_matrix); | 326 | output->wlr_output->transform_matrix); |
319 | 327 | ||
@@ -322,6 +330,7 @@ static void render_container_simple_border_pixel(struct sway_output *output, | |||
322 | box.y = con->y; | 330 | box.y = con->y; |
323 | box.width = con->width; | 331 | box.width = con->width; |
324 | box.height = con->sway_view->border_thickness; | 332 | box.height = con->sway_view->border_thickness; |
333 | scale_box(&box, output->wlr_output->scale); | ||
325 | wlr_render_rect(renderer, &box, color, | 334 | wlr_render_rect(renderer, &box, color, |
326 | output->wlr_output->transform_matrix); | 335 | output->wlr_output->transform_matrix); |
327 | 336 | ||
@@ -330,6 +339,7 @@ static void render_container_simple_border_pixel(struct sway_output *output, | |||
330 | box.y = con->y + con->height - con->sway_view->border_thickness; | 339 | box.y = con->y + con->height - con->sway_view->border_thickness; |
331 | box.width = con->width; | 340 | box.width = con->width; |
332 | box.height = con->sway_view->border_thickness; | 341 | box.height = con->sway_view->border_thickness; |
342 | scale_box(&box, output->wlr_output->scale); | ||
333 | wlr_render_rect(renderer, &box, color, | 343 | wlr_render_rect(renderer, &box, color, |
334 | output->wlr_output->transform_matrix); | 344 | output->wlr_output->transform_matrix); |
335 | } | 345 | } |