mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 02:02:14 +02:00
Allow resizing label to have lower background opacity if overall background opacity is low
This commit is contained in:
@@ -1335,10 +1335,10 @@ draw_resizing_text(OSWindow *w) {
|
||||
if (monotonic() - w->created_at > ms_to_monotonic_t(1000) && w->live_resize.num_of_resize_events > 1) {
|
||||
char text[32] = {0};
|
||||
unsigned int width = w->live_resize.width, height = w->live_resize.height;
|
||||
snprintf(text, sizeof(text), "%u x %u cells", width / w->fonts_data->fcm.cell_width, height / w->fonts_data->fcm.cell_height);
|
||||
snprintf(text, sizeof(text), "%u by %u cells", width / w->fonts_data->fcm.cell_width, height / w->fonts_data->fcm.cell_height);
|
||||
StringCanvas rendered = render_simple_text(w->fonts_data, text);
|
||||
if (rendered.canvas) {
|
||||
draw_centered_alpha_mask(width, height, rendered.width, rendered.height, rendered.canvas, 0.8f);
|
||||
draw_centered_alpha_mask(width, height, rendered.width, rendered.height, rendered.canvas, MAX(0.2f, MIN(OPT(background_opacity), 0.8f)));
|
||||
free(rendered.canvas);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user