- memset(shape, 0, sizeof(SHAPE));
- shape->bitlen = (draw->tag->len-1)*8;
- shape->data = (U8*)malloc(draw->tag->len-1);
- memcpy(shape->data, &draw->tag->data[1], draw->tag->len-1);
+ SWFSHAPEDRAWER*sdraw = (SWFSHAPEDRAWER*)draw->internal;
+ int tx = c1->x*20;
+ int ty = c1->y*20;
+ int x = to->x*20;
+ int y = to->y*20;
+ if(sdraw->lastx < sdraw->bbox.xmin) sdraw->bbox.xmin = sdraw->lastx;
+ if(sdraw->lasty < sdraw->bbox.ymin) sdraw->bbox.ymin = sdraw->lasty;
+ if(sdraw->lastx > sdraw->bbox.xmax) sdraw->bbox.xmax = sdraw->lastx;
+ if(sdraw->lasty > sdraw->bbox.ymax) sdraw->bbox.ymax = sdraw->lasty;
+ if(x < sdraw->bbox.xmin) sdraw->bbox.xmin = x;
+ if(y < sdraw->bbox.ymin) sdraw->bbox.ymin = y;
+ if(x > sdraw->bbox.xmax) sdraw->bbox.xmax = x;
+ if(y > sdraw->bbox.ymax) sdraw->bbox.ymax = y;
+ if(tx < sdraw->bbox.xmin) sdraw->bbox.xmin = tx;
+ if(ty < sdraw->bbox.ymin) sdraw->bbox.ymin = ty;
+ if(tx > sdraw->bbox.xmax) sdraw->bbox.xmax = tx;
+ if(ty > sdraw->bbox.ymax) sdraw->bbox.ymax = ty;
+ swf_ShapeSetCurve(sdraw->tag,sdraw->shape, tx-sdraw->lastx,ty-sdraw->lasty, x-tx,y-ty);
+ sdraw->lastx = x;
+ sdraw->lasty = y;
+ draw->pos = *to;