Fixed.
authorKoichi KAMICHI <kamichi@fonts.jp>
Tue, 15 Jun 2004 06:58:20 +0000 (06:58 +0000)
committerKoichi KAMICHI <kamichi@fonts.jp>
Tue, 15 Jun 2004 06:58:20 +0000 (06:58 +0000)
kagecgi/kagetool.c

index 58c46e4..ab7627c 100755 (executable)
@@ -10,8 +10,8 @@ void DotsWidth(int *dlx, int *drx){
        \r
     *dlx = 0;\r
     *drx = 0;\r
-    for(i = 0; i <= pngWidth && *dlx == 0; i++){\r
-               for(j = 0; j <= pngHeight; j++){\r
+    for(i = 0; i < canvasWidth && *dlx == 0; i++){\r
+               for(j = 0; j < canvasHeight; j++){\r
                        if(kageCanvas[j][i] == 0){\r
                                *dlx = i;\r
                                break;\r
@@ -19,8 +19,8 @@ void DotsWidth(int *dlx, int *drx){
                }\r
        }\r
        \r
-       for(i = pngWidth; i >= 0 && *drx == 0; i--){\r
-               for(j = 0; j <= pngHeight; j++){\r
+       for(i = canvasWidth - 1; i >= 0 && *drx == 0; i--){\r
+               for(j = 0; j < canvasHeight; j++){\r
                        if(kageCanvas[j][i] == 0){\r
                                *drx = i;\r
                                break;\r
@@ -34,8 +34,8 @@ void DotsHeight(int *dly, int *dry){
        \r
     *dly = 0;\r
        *dry = 0;\r
-    for(j = 0; j <= pngHeight && *dly == 0; j++){\r
-        for(i = 0; i <= pngWidth; i++){\r
+    for(j = 0; j < canvasHeight && *dly == 0; j++){\r
+        for(i = 0; i < canvasWidth; i++){\r
             if(kageCanvas[j][i] == 0){\r
                 *dly = j;\r
                 break;\r
@@ -43,8 +43,8 @@ void DotsHeight(int *dly, int *dry){
         }\r
     }\r
        \r
-    for(j = pngHeight; j >= 0 && *dry == 0; j--){\r
-        for(i = 0; i <= pngWidth; i++){\r
+    for(j = canvasHeight - 1; j >= 0 && *dry == 0; j--){\r
+        for(i = 0; i < canvasWidth; i++){\r
             if(kageCanvas[j][i] == 0){\r
                 *dry = j;\r
                 break;\r