mirror of
https://github.com/mpv-player/mpv
synced 2025-03-19 09:57:34 +00:00
osd_libass: --osd-back-color: apply to the progress bar
This is an artificial background box with the original colors, rendered as a plain rectangle instead of libass's opaque-box. Fixes #9134 (together with the previous commit)
This commit is contained in:
parent
c7cdd38ac9
commit
8489249af9
@ -424,6 +424,22 @@ static void update_progbar(struct osd_state *osd, struct osd_object *obj)
|
|||||||
talloc_free(buf.start);
|
talloc_free(buf.start);
|
||||||
|
|
||||||
struct ass_draw *d = &(struct ass_draw) { .scale = 4 };
|
struct ass_draw *d = &(struct ass_draw) { .scale = 4 };
|
||||||
|
|
||||||
|
if (osd->opts->osd_style->back_color.a) {
|
||||||
|
// the bar style always ignores the --osd-back-color config - it messes
|
||||||
|
// up the bar. draw an artificial box at the original back color.
|
||||||
|
struct m_color bc = osd->opts->osd_style->back_color;
|
||||||
|
d->text = talloc_asprintf_append(d->text,
|
||||||
|
"{\\pos(%f,%f)\\bord0\\1a&H%02X\\1c&H%02X%02X%02X&}",
|
||||||
|
px, py, 255 - bc.a, (int)bc.b, (int)bc.g, (int)bc.r);
|
||||||
|
|
||||||
|
ass_draw_start(d);
|
||||||
|
ass_draw_rect_cw(d, -border, -border, width + border, height + border);
|
||||||
|
ass_draw_stop(d);
|
||||||
|
add_osd_ass_event(track, "progbar", d->text);
|
||||||
|
ass_draw_reset(d);
|
||||||
|
}
|
||||||
|
|
||||||
// filled area
|
// filled area
|
||||||
d->text = talloc_asprintf_append(d->text, "{\\bord0\\pos(%f,%f)}", px, py);
|
d->text = talloc_asprintf_append(d->text, "{\\bord0\\pos(%f,%f)}", px, py);
|
||||||
ass_draw_start(d);
|
ass_draw_start(d);
|
||||||
|
Loading…
Reference in New Issue
Block a user