* fixed ShapeSetLine function
int ShapeSetEnd(LPTAG t)\r
{ if (!t) return -1;\r
SetBits(t,0,6);\r
+ ResetBitcount(t);\r
return 0;\r
}\r
\r
if (!t) return -1;\r
SetBits(t,3,2); // Straight Edge\r
\r
- if ((!s)||(s->px!=x)||(s->py!=y))\r
+ if ((!s)||((x!=0)&&(y!=0)))\r
{ b = CountBits(x,2);\r
b = CountBits(y,b);\r
- SetBits(t,b-2,4);\r
+ SetBits(t, b>=2 ? b-2 : 0, 4);\r
SetBits(t,1,1);\r
SetBits(t,x,b);\r
SetBits(t,y,b);\r
return 0;\r
}\r
\r
- if (s->px==x)\r
+ if (x==0)\r
{ b = CountBits(y,2);\r
- SetBits(t,b-2,4);\r
+ SetBits(t, b>=2 ? b-2 : 0, 4);\r
SetBits(t,1,2);\r
SetBits(t,y,b);\r
s->py += y;\r
}\r
else\r
{ b = CountBits(x,2);\r
- SetBits(t,b-2,4);\r
+ SetBits(t, b>=2 ? b-2 : 0, 4);\r
SetBits(t,0,2);\r
SetBits(t,x,b);\r
s->px += x;\r