]> O.S.I.I.S - jp/vkvg.git/commitdiff
surf and pattern status check when affecting to context
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 30 Oct 2022 06:57:26 +0000 (07:57 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 1 Mar 2023 17:56:44 +0000 (18:56 +0100)
src/vkvg_context.c

index a7738b9765205bb0bf804a47ec6ae759141ceb99..deee2d0c816e04d7b99e3bd3642ab8d593eb5184 100644 (file)
@@ -1043,7 +1043,7 @@ void vkvg_set_source_rgba (VkvgContext ctx, float r, float g, float b, float a)
        _update_cur_pattern (ctx, NULL);
 }
 void vkvg_set_source_surface(VkvgContext ctx, VkvgSurface surf, float x, float y){
-       if (ctx->status)
+       if (ctx->status || surf->status)
                return;
        RECORD(ctx, VKVG_CMD_SET_SOURCE_SURFACE, x, y, surf);
        ctx->pushConsts.source.x = x;
@@ -1052,7 +1052,7 @@ void vkvg_set_source_surface(VkvgContext ctx, VkvgSurface surf, float x, float y
        ctx->pushCstDirty = true;
 }
 void vkvg_set_source (VkvgContext ctx, VkvgPattern pat){
-       if (ctx->status)
+       if (ctx->status || pat->status)
                return;
        RECORD(ctx, VKVG_CMD_SET_SOURCE, pat);
        _update_cur_pattern (ctx, pat);