]> O.S.I.I.S - jp/vkvg.git/commitdiff
scale arc steps with current matrix
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 31 Jan 2020 06:19:58 +0000 (07:19 +0100)
committerj-p <jp_bruyere@hotmail.com>
Tue, 5 May 2020 20:14:27 +0000 (22:14 +0200)
appveyor.yml
src/vkvg_context.c
src/vkvg_context_internal.c
src/vkvg_context_internal.h

index f1b651a854bd239434525724c6fb8b7b7c5f92a2..c627c530784c02e3ef65ce4d613b7405f642ba0c 100644 (file)
@@ -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\*.exe build\*.lib
+        - 7z a vkvg.zip build\*.*
 
   -
     matrix:
@@ -54,7 +54,7 @@ for:
         - make
     after_build:
         - cd ..
-        - 7z a build/vkvg.zip build/*.so* build/test_*
+        - 7z a vkvg.zip build/*.so* build/test_*
     
 
 
index 3067528cf6508834303f3bb9c62a72231bfdf5e7..a2a0cb534a7be24fc72c2fc9869d9b0a7c855ca1 100644 (file)
@@ -373,7 +373,8 @@ 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(radius);
+    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))
@@ -416,7 +417,7 @@ void vkvg_arc_negative (VkvgContext ctx, float xc, float yc, float radius, float
 
     vec2 v = {cosf(a1)*radius + xc, sinf(a1)*radius + yc};
 
-    float step = _get_arc_step(radius);
+    float step = _get_arc_step(ctx, radius);
     float a = a1;
 
     if (_current_path_is_empty(ctx))
index cb72fdff06d6907828f2b72a372544b23e0ea7dc..423ba0527309b67acf5696ef40f1b7c16427188f 100644 (file)
@@ -172,8 +172,10 @@ float _normalizeAngle(float a)
     else
         return res;
 }
-float _get_arc_step (float radius) {
-    return M_PIF/sqrtf(radius)*0.35f;
+float _get_arc_step (VkvgContext ctx, float radius) {
+    float dx = 1, dy = 1;
+    vkvg_matrix_transform_distance (&ctx->pushConsts.mat, &dx, &dy);
+    return M_PIF/sqrtf(radius)*0.35f/fmaxf(dx,dy);
 }
 void _create_gradient_buff (VkvgContext ctx){
     vkvg_buffer_create (ctx->pSurf->dev,
index 4a0bbf4c37cd3658e776e4a4003a004035abf412..052813bf6eefa7a2cf1048057be2d6f7d0281a59 100644 (file)
@@ -182,7 +182,7 @@ void _set_curve_end         (VkvgContext ctx);
 bool _path_has_curves       (VkvgContext ctx, uint32_t ptrPath);
 
 float _normalizeAngle       (float a);
-float _get_arc_step         (float radius);
+float _get_arc_step         (VkvgContext ctx, float radius);
 
 vec2 _get_current_position  (VkvgContext ctx);
 void _add_point                (VkvgContext ctx, float x, float y);