mirror of
https://github.com/swaywm/sway.git
synced 2025-03-03 22:24:44 +01:00
sway_text_node: Apply max_width when rendering
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.
This commit is contained in:
parent
7fab75a7a6
commit
8a60f30423
1 changed files with 2 additions and 2 deletions
|
@ -87,7 +87,7 @@ static void render_backing_buffer(struct text_buffer *buffer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float scale = buffer->scale;
|
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);
|
int height = ceil(buffer->props.height * scale);
|
||||||
float *color = (float *)&buffer->props.color;
|
float *color = (float *)&buffer->props.color;
|
||||||
float *background = (float *)&buffer->props.background;
|
float *background = (float *)&buffer->props.background;
|
||||||
|
@ -153,7 +153,7 @@ static void render_backing_buffer(struct text_buffer *buffer) {
|
||||||
pixman_region32_init(&opaque);
|
pixman_region32_init(&opaque);
|
||||||
if (background[3] == 1) {
|
if (background[3] == 1) {
|
||||||
pixman_region32_union_rect(&opaque, &opaque, 0, 0,
|
pixman_region32_union_rect(&opaque, &opaque, 0, 0,
|
||||||
buffer->props.width, buffer->props.height);
|
get_text_width(&buffer->props), buffer->props.height);
|
||||||
}
|
}
|
||||||
wlr_scene_buffer_set_opaque_region(buffer->buffer_node, &opaque);
|
wlr_scene_buffer_set_opaque_region(buffer->buffer_node, &opaque);
|
||||||
pixman_region32_fini(&opaque);
|
pixman_region32_fini(&opaque);
|
||||||
|
|
Loading…
Add table
Reference in a new issue