Skip to content

Commit

Permalink
sway_text_node: Apply max_width when rendering
Browse files Browse the repository at this point in the history
max_width was applied to the source box, but not to the cairo surface.
The cairo surface would therefore take on arbitrarily large dimensions
according to the required dimensions to fit the text input, which if
large enough would cause failures during output rendering and leave a
black hole in the titlebar.
  • Loading branch information
kennylevinsen committed Feb 25, 2025
1 parent 10e50e6 commit 06fe282
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sway/sway_text_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static void render_backing_buffer(struct text_buffer *buffer) {
}

float scale = buffer->scale;
int width = ceil(buffer->props.width * scale);
int width = ceil(get_text_width(&buffer->props) * scale);
int height = ceil(buffer->props.height * scale);
float *color = (float *)&buffer->props.color;
float *background = (float *)&buffer->props.background;
Expand Down

0 comments on commit 06fe282

Please sign in to comment.