summaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2022-03-11 01:47:02 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2022-03-11 01:47:02 +0100
commit9e037ab70f5cfb6b54ec842e098ab7ae929dd289 (patch)
tree55a87f2bf71af1afefcff7f22a49ba551feb4d2f
parent4ef1526a139be80924e13bd2c0815b631ac8140f (diff)
default solid color for context to opaque black
-rw-r--r--src/vkvg_context.c27
1 files changed, 16 insertions, 11 deletions
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) {