From: Jean-Philippe Bruyère Date: Sun, 20 Feb 2022 21:10:08 +0000 (+0100) Subject: record return value fix for vkvg_rectangle X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=970c81a75e81ded8121b888f89257fc1fcadcbe1;p=jp%2Fvkvg.git record return value fix for vkvg_rectangle --- diff --git a/src/recording/vkvg_record_internal.h b/src/recording/vkvg_record_internal.h index a52a3b8..13e6b1a 100644 --- a/src/recording/vkvg_record_internal.h +++ b/src/recording/vkvg_record_internal.h @@ -122,6 +122,12 @@ void _record (vkvg_recording_t* rec,...); return;\ }\ } +#define RECORD2(ctx,...) {\ + if (ctx->recording) {\ + _record (ctx->recording,__VA_ARGS__);\ + return 0;\ + }\ +} #endif diff --git a/src/vkvg_context.c b/src/vkvg_context.c index 4a9fda9..03988ab 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -610,7 +610,7 @@ void vkvg_fill_rectangle (VkvgContext ctx, float x, float y, float w, float h){ vkvg_status_t vkvg_rectangle (VkvgContext ctx, float x, float y, float w, float h){ if (ctx->status) return ctx->status; - RECORD(ctx, VKVG_CMD_RECTANGLE, x, y, w, h); + RECORD2(ctx, VKVG_CMD_RECTANGLE, x, y, w, h); LOG(VKVG_LOG_INFO_CMD, "\tCMD: rectangle: %f,%f,%f,%f\n", x, y, w, h); _finish_path (ctx);