From: Jean-Philippe Bruyère Date: Tue, 21 Dec 2021 06:47:29 +0000 (+0100) Subject: update tests X-Git-Tag: v0.2.0~2 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=d41c995563e524c3946988cda2703a225f3df593;p=jp%2Fvkvg.git update tests --- diff --git a/tests/inverse_colinear.c b/tests/inverse_colinear.c index f643d4e..be9fc52 100644 --- a/tests/inverse_colinear.c +++ b/tests/inverse_colinear.c @@ -7,14 +7,21 @@ float lineWidth = 50.0f; vkvg_line_join_t lineJoin = VKVG_LINE_JOIN_MITER; vkvg_line_cap_t lineCap = VKVG_LINE_CAP_BUTT; bool isClosed = false; +bool startWithArc = false, endWithArc = false; int ptsCount = 4; int initPtsCount = 4; -vec2 pts[] = { +/*vec2 pts[] = { {150,150}, {200,300}, {250,150}, {280,350}, +};*/ +vec2 pts[] = { + {150,150}, + {250,150}, + {100,150}, + {150,200}, }; int hoverPt = -1; double pointSize = 7; @@ -35,9 +42,18 @@ void draw (){ vkvg_set_line_width(ctx,lineWidth); vkvg_set_line_join (ctx, lineJoin); vkvg_set_line_cap (ctx, lineCap); - vkvg_move_to(ctx,pts[0].x,pts[0].y); - for (int i=1; i 2) diff --git a/tests/test1.c b/tests/test1.c index 7b66037..9ffdd74 100644 --- a/tests/test1.c +++ b/tests/test1.c @@ -101,7 +101,7 @@ void cairo_test_text (VkvgContext cr) { vkvg_stroke (cr); vkvg_move_to (cr, x,y); - vkvg_rel_line_to (cr, 0, -ft.descent); + vkvg_rel_line_to (cr, 0, ft.descent); vkvg_rel_line_to (cr, extents.width, 0); vkvg_set_source_rgba (cr, 0.9f, 0.0, 0.0, 0.6f); @@ -238,13 +238,13 @@ void cairo_print_arc_neg (VkvgContext cr){ float angle2 = 180.0f * (M_PIF/180.0f); /* in radians */ vkvg_set_source_rgba(cr, 0, 0, 0, 1); - vkvg_set_line_width (cr, 5.0f); + vkvg_set_line_width (cr, 10.0f); vkvg_arc_negative (cr, xc, yc, radius, angle1, angle2); vkvg_stroke (cr); /* draw helping lines */ vkvg_set_source_rgba (cr, 1, 0.2f, 0.2f, 0.6f); - vkvg_set_line_width (cr, 10.0f); + vkvg_set_line_width (cr, 6.0f); vkvg_arc (cr, xc, yc, 10.0f, 0, 2.f*M_PIF); vkvg_fill (cr);