int lastwasfill;
int shapeisempty;
char fill;
- int max_x;
- int max_y;
+ int min_x,max_x;
+ int min_y,max_y;
TAG* cliptags[128];
int clipshapes[128];
U32 clipdepths[128];
tmp->last = 0;
while(1) {
+ double previousx = x, previousy = y;
if(tmp) {
x += (tmp->dest.x/(float)0xffff);
y += (tmp->dest.y/(float)0xffff);
}
if(!tmp || tmp->type == SWF_PATHTYPE_MOVE) {
if(valid && last) {
+ if(fabs(lastx-previousx)<0.001 && fabs(lasty-previousy)<0.001) {
+ /* endpoints match- the path is closed.
+ Don't bother to draw endings */
+ drawShortPath(obj, lastx, lasty, m, last);
+ }
if(last->type == SWF_PATHTYPE_LINE && t1linelen(obj,last)>line_width*2 &&
lastwasline && line_cap != LINE_CAP_ROUND)
drawShortPathWithStraightEnds(obj, lastx, lasty, m, last, valid, line_cap, line_join, line_width);
lasty = y;
} else {
if(!last)
- last = tmp;
+ last = tmp; //remember last stroke start (first segment after moveto)
valid++;
}
swf_SetRect(i->tag,&r);
MATRIX m;
- swf_GetMatrix(0, &m);
+ swf_GetMatrix(0, &m); /* set unit matrix- the real matrix is in the placeobject */
swf_SetMatrix(i->tag,&m);
putcharacters(obj, i->tag);
swf_PlaceObjectFree(&obj);
}
+ i->min_x = x1;
+ i->min_y = y1;
i->max_x = x2;
i->max_y = y2;
fixAreas(obj);
if(i->shapeisempty ||
+ /*bbox empty?*/
(i->bboxrect.xmin == i->bboxrect.xmax &&
- i->bboxrect.ymin == i->bboxrect.ymax))
+ i->bboxrect.ymin == i->bboxrect.ymax))
{
// delete the shape again, we didn't do anything
cancelshape(obj);
if(i->tag && i->tag->id == ST_END)
return; //already done
-
+
if(i->frameno == i->lastframeno) // fix: add missing pagefeed
swfoutput_pagefeed(obj);
iterator = iterator->next;
}
i->tag = swf_InsertTag(i->tag,ST_END);
+ TAG* tag = i->tag->prev;
+
+ /* remove the removeobject2 tags between the last ST_SHOWFRAME
+ and the ST_END- they confuse the flash player */
+ while(tag->id == ST_REMOVEOBJECT2) {
+ TAG* prev = tag->prev;
+ swf_DeleteTag(tag);
+ tag = prev;
+ }
}
SWF* swfoutput_get(struct swfoutput*obj)
m.r0 = (int)(65536*20*(p1.x-p2.x)/sizey);
m.sy = -(int)(65536*20*(p1.y-p2.y)/sizey);
- m.tx = (int)(p1.x*20);
- m.ty = (int)(p1.y*20);
+ m.tx = (int)(p1.x*20) - 10;
+ m.ty = (int)(p1.y*20) - 10;
/* shape */
myshapeid = ++i->currentswfid;