vec2 v = {cosf(a1)*radius + xc, sinf(a1)*radius + yc};
- float step = M_PIF/radius*1.5f;
+ float step = M_PIF/radius*0.5f;
float a = a1;
if (_current_path_is_empty(ctx))
_add_point (ctx, v.x, v.y);
a+=step;
}
- if (EQUF(a2-a1,M_PIF*2.f))//if arc is complete circle, last point is the same as the first one
+ if (EQUF(a2-a1,M_PIF*2.f)){//if arc is complete circle, last point is the same as the first one
+ vkvg_close_path(ctx);
return;
+ }
a = a2;
vec2 lastP = v;
v.x = cosf(a)*radius + xc;
--- /dev/null
+#include "test.h"
+
+void test(){
+ VkvgContext ctx = vkvg_create(surf);
+
+ vkvg_set_line_width(ctx, 0.5);
+ vkvg_set_source_rgb (ctx, 1,1,1);
+ vkvg_paint(ctx);
+ vkvg_set_source_rgb (ctx, 0,0,0);
+
+ vkvg_scale(ctx,3,3);
+ vkvg_arc(ctx, 150, 100, 3.5, 0, M_PI*2);
+ vkvg_stroke(ctx);
+ vkvg_arc(ctx, 200, 200, 10, 0, M_PI*2);
+ vkvg_fill(ctx);
+
+ vkvg_destroy(ctx);
+}
+
+int main(int argc, char *argv[]) {
+
+ perform_test (test, 1024, 768);
+
+ return 0;
+}