Skip to content
Snippets Groups Projects
Commit 2c23c840 authored by dos's avatar dos Committed by pippin
Browse files

video_mpeg: Wrap in ctx_save/restore pair

parent 9208c757
No related branches found
No related tags found
1 merge request!556Media has video has audio
Pipeline #9173 passed
...@@ -155,6 +155,7 @@ static void mpg1_draw(st3m_media *media, Ctx *ctx) { ...@@ -155,6 +155,7 @@ static void mpg1_draw(st3m_media *media, Ctx *ctx) {
ctx_gray(ctx, 0.0); ctx_gray(ctx, 0.0);
ctx_fill(ctx); ctx_fill(ctx);
} }
ctx_save(ctx);
ctx_translate(ctx, -dim / 2, -dim / 2); ctx_translate(ctx, -dim / 2, -dim / 2);
ctx_translate(ctx, (dim - mpg1->width * scale) / 2.0 + cx, ctx_translate(ctx, (dim - mpg1->width * scale) / 2.0 + cx,
(dim - mpg1->height * scale) / 2.0 + cy); (dim - mpg1->height * scale) / 2.0 + cy);
...@@ -167,6 +168,7 @@ static void mpg1_draw(st3m_media *media, Ctx *ctx) { ...@@ -167,6 +168,7 @@ static void mpg1_draw(st3m_media *media, Ctx *ctx) {
ctx_image_smoothing(ctx, false); ctx_image_smoothing(ctx, false);
ctx_compositing_mode(ctx, CTX_COMPOSITE_COPY); ctx_compositing_mode(ctx, CTX_COMPOSITE_COPY);
ctx_fill(ctx); ctx_fill(ctx);
ctx_restore(ctx);
} }
} else { } else {
ctx_rgb(ctx, 0.2, 0.3, 0.4); ctx_rgb(ctx, 0.2, 0.3, 0.4);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment