mirror of
https://github.com/swaywm/sway.git
synced 2025-11-10 13:29:51 -05:00
Use scissor to render title texture
This allows the title's texture to always be the full width of the text, and clipped at render time according to the desired width (eg. tabs...). As an added bonus, the texture no longer needs to be updated when containers are arranged.
This commit is contained in:
parent
fbcbbb976c
commit
e83e5487be
3 changed files with 3 additions and 12 deletions
|
|
@ -584,12 +584,6 @@ static void update_title_texture(struct sway_container *con,
|
|||
get_text_size(c, config->font, &width, NULL, scale, false, "%s", con->name);
|
||||
cairo_destroy(c);
|
||||
|
||||
int borders = (con->type == C_VIEW ? con->sway_view->border_thickness :
|
||||
config->border_thickness) * 2 * scale;
|
||||
if (width > con->width * scale - borders) {
|
||||
width = con->width * scale - borders;
|
||||
}
|
||||
|
||||
cairo_surface_t *surface = cairo_image_surface_create(
|
||||
CAIRO_FORMAT_ARGB32, width, height);
|
||||
cairo_t *cairo = cairo_create(surface);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue