X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfshape.c;h=dbd6c56e1a4499395b27385768ee5c103f34836c;hb=dd195e15ca8bd13a7cce5500bd9a7d2b8c21c8aa;hp=c09f30d95f57ad3796bf727bcde3090c3123b151;hpb=fc554a43712b76d16b41ec77dd311b4a78b1ef6b;p=swftools.git diff --git a/lib/modules/swfshape.c b/lib/modules/swfshape.c index c09f30d..dbd6c56 100644 --- a/lib/modules/swfshape.c +++ b/lib/modules/swfshape.c @@ -438,6 +438,7 @@ int ShapeSetAll(LPTAG t,LPSHAPE s,S32 x,S32 y,U16 line,U16 fill0,U16 fill1) int ShapeSetEnd(LPTAG t) { if (!t) return -1; SetBits(t,0,6); + ResetBitcount(t); return 0; } @@ -446,10 +447,12 @@ int ShapeSetLine(LPTAG t,LPSHAPE s,S32 x,S32 y) if (!t) return -1; SetBits(t,3,2); // Straight Edge - if ((!s)||(s->px!=x)||(s->py!=y)) + if ((!s)||((x!=0)&&(y!=0))) { b = CountBits(x,2); b = CountBits(y,b); - SetBits(t,b-2,4); + if(b<2) + b=2; + SetBits(t, b-2, 4); SetBits(t,1,1); SetBits(t,x,b); SetBits(t,y,b); @@ -460,16 +463,20 @@ int ShapeSetLine(LPTAG t,LPSHAPE s,S32 x,S32 y) return 0; } - if (s->px==x) + if (x==0) { b = CountBits(y,2); - SetBits(t,b-2,4); + if(b<2) + b=2; + SetBits(t, b-2, 4); SetBits(t,1,2); SetBits(t,y,b); s->py += y; } else { b = CountBits(x,2); - SetBits(t,b-2,4); + if(b<2) + b=2; + SetBits(t, b-2, 4); SetBits(t,0,2); SetBits(t,x,b); s->px += x;