int bboxrectpos;
SRECT bboxrect;
+ SRECT pagebbox;
+
chardata_t chardata[CHARDATAMAX];
int chardatapos;
int firstpage;
SRECT r;
r = getcharacterbbox(dev, i->swffont, &i->fontmatrix);
-
+ r = swf_ClipRect(i->pagebbox, r);
swf_SetRect(i->tag,&r);
swf_SetMatrix(i->tag,&i->fontmatrix);
i->max_y = height;
i->watermarks = 0;
- /* set clipping/background rectangle */
- /* TODO: this should all be done in SWFOutputDev */
- //setBackground(dev, x1, y1, x2, y2);
+ /* create a bbox structure with the page size. This is used
+ for clipping shape and text bounding boxes. As we don't want to
+ generate bounding boxes which extend beyond the movie size (in
+ order to not confuse Flash), we clip everything against i->pagebbox */
+ i->pagebbox.xmin = 0;
+ i->pagebbox.ymin = 0;
+ i->pagebbox.xmax = width*20;
+ i->pagebbox.ymax = height*20;
/* increase SWF's bounding box */
- SRECT r;
- r.xmin = 0;
- r.ymin = 0;
- r.xmax = width*20;
- r.ymax = height*20;
- swf_ExpandRect2(&i->swf->movieSize, &r);
+ swf_ExpandRect2(&i->swf->movieSize, &i->pagebbox);
i->lastframeno = i->frameno;
i->firstpage = 0;
i->bboxrectpos = i->tag->len;
/* changed later */
- r.xmin = 0;
- r.ymin = 0;
- r.xmax = 20*i->max_x;
- r.ymax = 20*i->max_y;
- swf_SetRect(i->tag,&r);
+ swf_SetRect(i->tag,&i->pagebbox);
memset(&i->bboxrect, 0, sizeof(i->bboxrect));
swf_ShapeSetEnd(i->tag);
- changeRect(dev, i->tag, i->bboxrectpos, &i->bboxrect);
+ SRECT r = swf_ClipRect(i->pagebbox, i->bboxrect);
+ changeRect(dev, i->tag, i->bboxrectpos, &r);
msg("<trace> Placing shape ID %d", i->shapeid);
r.ymin = (int)(bbox.ymin*20);
r.xmax = (int)(bbox.xmax*20);
r.ymax = (int)(bbox.ymax*20);
+ r = swf_ClipRect(i->pagebbox, r);
swf_SetRect(i->tag,&r);
swf_SetShapeStyles(i->tag,i->shape);
swf_ShapeCountBits(i->shape,NULL,NULL);
r.ymin = (int)(bbox.ymin*20);
r.xmax = (int)(bbox.xmax*20);
r.ymax = (int)(bbox.ymax*20);
+ r = swf_ClipRect(i->pagebbox, r);
swf_SetRect(i->tag,&r);
swf_SetShapeStyles(i->tag,i->shape);
swf_ShapeCountBits(i->shape,NULL,NULL);
int fsid = swf_ShapeAddBitmapFillStyle(shape,&m,bitid,1);
swf_SetU16(i->tag, myshapeid);
SRECT r = gfxline_getSWFbbox(line);
+ r = swf_ClipRect(i->pagebbox, r);
swf_SetRect(i->tag,&r);
swf_SetShapeStyles(i->tag,shape);
swf_ShapeCountBits(shape,NULL,NULL);
swf_SetU16(i->tag,myshapeid);
SRECT r = gfxline_getSWFbbox(line);
+ r = swf_ClipRect(i->pagebbox, r);
swf_SetRect(i->tag,&r);
swf_SetShapeStyles(i->tag,shape);
swf_ShapeCountBits(shape,NULL,NULL);
}
swf_SetU16(i->tag,myshapeid);
SRECT r = gfxline_getSWFbbox(line);
+ r = swf_ClipRect(i->pagebbox, r);
swf_SetRect(i->tag,&r);
swf_SetShapeStyles(i->tag,shape);
swf_ShapeCountBits(shape,NULL,NULL);
int fsid = swf_ShapeAddGradientFillStyle(shape,&m,swfgradient,type==gfxgradient_radial);
swf_SetU16(i->tag, myshapeid);
SRECT r = gfxline_getSWFbbox(line);
+ r = swf_ClipRect(i->pagebbox, r);
swf_SetRect(i->tag,&r);
swf_SetShapeStyles(i->tag,shape);
swf_ShapeCountBits(shape,NULL,NULL);