]> O.S.I.I.S - jp/vkvg.git/commitdiff
update tests
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 5 Mar 2022 08:05:27 +0000 (09:05 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 5 Mar 2022 08:05:27 +0000 (09:05 +0100)
tests/colinear.c
tests/inverse_colinear.c
tests/vkvg-svg/svg-viewer.c

index 595ff213a2d731cc10f6744c02aedab9ee178c6d..9e7d32e4edcc1420a3726b1616d4d72fc6047a0f 100644 (file)
@@ -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);
index f239ba64445c1b7aff9dec0a2c59263b2247a507..88de07596508aaedf071f2798865b35e15d32dc3 100644 (file)
@@ -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;
        }
 }
index 353430275e14763ad356c66751f85a9218bdc474..b44415d59042507d0ec8d6ddadc30b511e533af7 100644 (file)
@@ -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);
 }