diff --git a/testings/testing_treedraw.c b/testings/testing_treedraw.c
index 680ece49527495db308bcdb38b44806c61c5d0f4..8ccebd0ba21cb70c62e4c90965d1b332a739539d 100644
--- a/testings/testing_treedraw.c
+++ b/testings/testing_treedraw.c
@@ -49,12 +49,22 @@ main(int argc, char ** argv)
         libhqr_treewalk(&qrtree, k, tiles, tree, SIZE);
         /* Drawing the rectangles */
         for (i = k + 1; i < maxMN; i++){
-            absciss1 = ((SIZE * 3) /4) + SIZE * tiles[i];
-            ordinate1 = ((SIZE * 3) /4) + SIZE * i;
-            libhqr_drawTS(absciss1, ordinate1, WIDTH, HEIGHT, k, tree);
-            j = qrtree.currpiv(&qrtree, k, i);
-            ordinate1 = ((SIZE * 3) /4) + SIZE * j;
-            libhqr_drawTT(absciss1, ordinate1, WIDTH, HEIGHT, k, tree);
+            if(qrtree.gettype(&qrtree, k, i) == 0){
+                absciss1 = ((SIZE * 3) /4) + SIZE * tiles[i];
+                ordinate1 = ((SIZE * 3) /4) + SIZE * i;
+                libhqr_drawTS(absciss1, ordinate1, WIDTH, HEIGHT, k, tree);
+                j = qrtree.currpiv(&qrtree, k, i);
+                ordinate1 = ((SIZE * 3) /4) + SIZE * j;
+                libhqr_drawTT(absciss1, ordinate1, WIDTH, HEIGHT, k, tree);
+            }
+            else {
+                absciss1 = ((SIZE * 3) /4) + SIZE * tiles[i];
+                ordinate1 = ((SIZE * 3) /4) + SIZE * i;
+                libhqr_drawTS(absciss1, ordinate1, WIDTH, HEIGHT, k, tree);
+                j = qrtree.currpiv(&qrtree, k, i);
+                ordinate1 = ((SIZE * 3) /4) + SIZE * j;
+                libhqr_drawTT(absciss1, ordinate1, WIDTH, HEIGHT, k, tree);
+            }
         }
     }
     libhqr_writeend(tree);