From 873610656b4ac2d4595721fee07f0671f4911d73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sun, 20 Feb 2022 22:10:08 +0100 Subject: [PATCH] record return value fix for vkvg_rectangle --- src/recording/vkvg_record_internal.h | 6 ++++++ src/vkvg_context.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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); -- 2.47.3