From: Jean-Philippe Bruyère Date: Fri, 11 Mar 2022 00:47:02 +0000 (+0100) Subject: default solid color for context to opaque black X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=9e037ab70f5cfb6b54ec842e098ab7ae929dd289;p=jp%2Fvkvg.git default solid color for context to opaque black --- diff --git a/src/vkvg_context.c b/src/vkvg_context.c index c558976..5b4a693 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -75,13 +75,14 @@ void _init_ctx (VkvgContext ctx) { else ctx->renderPassBeginInfo.clearValueCount = 3; - ctx->selectedCharSize = 10 << 6; - ctx->currentFont = NULL; - ctx->selectedFontName[0] = 0; - ctx->pattern = NULL; - ctx->cmdStarted = false; - ctx->curClipState = vkvg_clip_state_none; - ctx->vertCount = ctx->indCount = ctx->curColor = 0; + ctx->selectedCharSize = 10 << 6; + ctx->currentFont = NULL; + ctx->selectedFontName[0]= 0; + ctx->pattern = NULL; + ctx->curColor = 0xff000000;//opaque black + ctx->cmdStarted = false; + ctx->curClipState = vkvg_clip_state_none; + ctx->vertCount = ctx->indCount = 0; } VkvgContext vkvg_create(VkvgSurface surf) @@ -1599,10 +1600,14 @@ void vkvg_ellipse (VkvgContext ctx, float radiusX, float radiusY, float x, float float bottomLeftX = bottomCenterX - dx2; float bottomLeftY = bottomCenterY - dy2; - vkvg_move_to (ctx, bottomCenterX, bottomCenterY); - vkvg_curve_to (ctx, bottomRightX, bottomRightY, topRightX, topRightY, topCenterX, topCenterY); - vkvg_curve_to (ctx, topLeftX, topLeftY, bottomLeftX, bottomLeftY, bottomCenterX, bottomCenterY); - vkvg_close_path (ctx); + _finish_path(ctx); + _add_point (ctx, bottomCenterX, bottomCenterY); + + _curve_to (ctx, bottomRightX, bottomRightY, topRightX, topRightY, topCenterX, topCenterY); + _curve_to (ctx, topLeftX, topLeftY, bottomLeftX, bottomLeftY, bottomCenterX, bottomCenterY); + + ctx->pathes[ctx->pathPtr] |= PATH_CLOSED_BIT; + _finish_path(ctx); } VkvgSurface vkvg_get_target (VkvgContext ctx) {