From: Jean-Philippe Bruyère Date: Fri, 31 Jan 2020 09:30:13 +0000 (+0100) Subject: cancel stroke with dash_invalid status if all dashes are 0 X-Git-Tag: v0.1-alpha~28 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=8e4c7203af3ba417a0914d16c926af24b25e62d2;p=jp%2Fvkvg.git cancel stroke with dash_invalid status if all dashes are 0 --- diff --git a/appveyor.yml b/appveyor.yml index 9543188..c627c53 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -34,7 +34,7 @@ for: - msbuild vkvg.sln /p:Configuration=Debug /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" after_build: - cd .. - - 7z a vkvg.zip build\*.dll build\*.lib build\*.exe + - 7z a vkvg.zip build\*.* - matrix: diff --git a/src/vkvg_context.c b/src/vkvg_context.c index a2a0cb5..b6a4052 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -374,7 +374,6 @@ void vkvg_arc (VkvgContext ctx, float xc, float yc, float radius, float a1, floa vec2 v = {cosf(a1)*radius + xc, sinf(a1)*radius + yc}; float step = _get_arc_step(ctx, radius); - printf ("steps: %.2f\n", 2.f*M_PIF/step); float a = a1; if (_current_path_is_empty(ctx)) @@ -717,9 +716,13 @@ void vkvg_stroke_preserve (VkvgContext ctx) float totDashLength = 0; for (uint32_t i=0;idashCount;i++) totDashLength+=ctx->dashes[i]; - if (EQUF(ctx->dashOffset, 0)||EQUF(totDashLength, 0)) + if (totDashLength == 0){ + ctx->status = VKVG_STATUS_INVALID_DASH; + return; + } + /*if (ctx->dashOffset == 0) curDashOffset = 0; - else + else*/ curDashOffset = fmodf(ctx->dashOffset, totDashLength); //cur dash offset between defined path point and last dash segment(on/off) start //-----