diff options
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r-- | sway/desktop/render.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index ea9c37d9..4d242bd7 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -50,7 +50,7 @@ struct render_data { * scaled to 2px. */ static int scale_length(int length, int offset, float scale) { - return round((offset + length) * scale) - round(offset * scale); + return roundf((offset + length) * scale) - roundf(offset * scale); } static void scissor_output(struct wlr_output *wlr_output, @@ -482,7 +482,7 @@ static void render_titlebar(struct sway_output *output, size_t inner_width = width - titlebar_h_padding * 2; // output-buffer local - int ob_inner_x = round(inner_x * output_scale); + int ob_inner_x = roundf(inner_x * output_scale); int ob_inner_width = scale_length(inner_width, inner_x, output_scale); int ob_bg_height = scale_length( (titlebar_v_padding - titlebar_border_thickness) * 2 + @@ -531,7 +531,7 @@ static void render_titlebar(struct sway_output *output, memcpy(&color, colors->background, sizeof(float) * 4); premultiply_alpha(color, con->alpha); box.x = texture_box.x + round(output_x * output_scale); - box.y = round((y + titlebar_border_thickness) * output_scale); + box.y = roundf((y + titlebar_border_thickness) * output_scale); box.width = texture_box.width; box.height = ob_padding_above; render_rect(output, output_damage, &box, color); @@ -562,7 +562,7 @@ static void render_titlebar(struct sway_output *output, // The title texture might be shorter than the config->font_height, // in which case we need to pad it above and below. - int ob_padding_above = round((titlebar_v_padding - + int ob_padding_above = roundf((titlebar_v_padding - titlebar_border_thickness) * output_scale); int ob_padding_below = ob_bg_height - ob_padding_above - texture_box.height; @@ -607,7 +607,7 @@ static void render_titlebar(struct sway_output *output, memcpy(&color, colors->background, sizeof(float) * 4); premultiply_alpha(color, con->alpha); box.x = texture_box.x + round(output_x * output_scale); - box.y = round((y + titlebar_border_thickness) * output_scale); + box.y = roundf((y + titlebar_border_thickness) * output_scale); box.width = texture_box.width; box.height = ob_padding_above; render_rect(output, output_damage, &box, color); @@ -647,7 +647,7 @@ static void render_titlebar(struct sway_output *output, box.width = ob_right_x - ob_left_x - ob_left_width; if (box.width > 0) { box.x = ob_left_x + ob_left_width + round(output_x * output_scale); - box.y = round(bg_y * output_scale); + box.y = roundf(bg_y * output_scale); box.height = ob_bg_height; render_rect(output, output_damage, &box, color); } |