\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
}\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
\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
}\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