From: Jean-Philippe Bruyère Date: Sat, 5 Mar 2022 08:05:27 +0000 (+0100) Subject: update tests X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=ca71dec3e5c410977c40a4b6eac0cb503d72424e;p=jp%2Fvkvg.git update tests --- diff --git a/tests/colinear.c b/tests/colinear.c index 595ff21..9e7d32e 100644 --- a/tests/colinear.c +++ b/tests/colinear.c @@ -11,7 +11,7 @@ void test(){ vkvg_move_to(ctx,100,100); vkvg_line_to(ctx,100,200); - vkvg_line_to(ctx,100,100); + vkvg_line_to(ctx,100,300); vkvg_stroke(ctx); vkvg_destroy(ctx); diff --git a/tests/inverse_colinear.c b/tests/inverse_colinear.c index f239ba6..88de075 100644 --- a/tests/inverse_colinear.c +++ b/tests/inverse_colinear.c @@ -77,7 +77,7 @@ void draw (){ vkvg_destroy(ctx); } static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) { - if (action != GLFW_PRESS) + if (action == GLFW_RELEASE) return; switch (key) { case GLFW_KEY_ESCAPE : @@ -120,13 +120,21 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action, else miterLimit *= 2.0f; break; + case GLFW_KEY_P : + if (mods & GLFW_MOD_SHIFT) { + if (ptsCount > 1) + ptsCount--; + } else { + if (ptsCount < initPtsCount) + ptsCount++; + } + break; case GLFW_KEY_KP_ADD : - if (ptsCount < initPtsCount) - ptsCount++; + lineWidth++; break; case GLFW_KEY_KP_SUBTRACT : - if (ptsCount > 1) - ptsCount--; + if (lineWidth > 1) + lineWidth--; break; } } diff --git a/tests/vkvg-svg/svg-viewer.c b/tests/vkvg-svg/svg-viewer.c index 3534302..b44415d 100644 --- a/tests/vkvg-svg/svg-viewer.c +++ b/tests/vkvg-svg/svg-viewer.c @@ -204,6 +204,9 @@ void print_help_and_exit () { printf("\t\t\tif the -d option is not specified, svgfile path is mandatory.\n"); printf("\t-i size:\tif -d option is present, display all svg files as a list with the size specified.\n"); printf("\t-m margin:\tset margin for the -i option\n"); + printf("\t-w width:\tset output surface width.\n"); + printf("\t-h height:\tset output surface height.\n"); + printf("\t-s samples:\tset sample count, set to 1 to disable multisampling.\n"); printf("\n"); exit(-1); }