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);
double ifs = 1.0 / (i->current_font_size*GLYPH_SCALE);
MATRIX m;
- m.sx = (U32)((m11*ifs)*65536); m.r1 = (U32)((m21*ifs)*65536);
- m.r0 = (U32)((m12*ifs)*65536); m.sy = (U32)((m22*ifs)*65536);
+ m.sx = (S32)((m11*ifs)*65536); m.r1 = (S32)((m21*ifs)*65536);
+ m.r0 = (S32)((m12*ifs)*65536); m.sy = (S32)((m22*ifs)*65536);
/* this is the position of the first char to set a new fontmatrix-
we hope that it's close enough to all other characters using the
font, so we use its position as origin for the matrix */
for(y=0;y<watermark2_height;y++)
for(x=0;x<watermark2_width;x++) {
if(((watermark2[x]>>y)&1)) {
- if(!drawall && lrand48()%5)
+ if(!drawall && rand()%5)
continue;
- unsigned int b = lrand48();
+ unsigned int b = rand();
moveto(dev, i->tag, x*sx+tx+((b>>1)&1)/20.0, y*sy+ty+((b>>3)&1)/20.0);
lineto(dev, i->tag, x*sx+px+tx+((b>>2)&1)/20.0, y*sy+ty+((b>>3)&1)/20.0);
lineto(dev, i->tag, x*sx+px+tx+((b>>2)&1)/20.0, y*sy+py+ty+((b>>4)&1)/20.0);
if(drawall) {
swfoutput_setfillcolor(dev, 0,0,255,192);
} else {
- swfoutput_setfillcolor(dev, lrand48(),lrand48(),lrand48(),(lrand48()&127)+128);
+ swfoutput_setfillcolor(dev, rand(),rand(),rand(),(rand()&127)+128);
}
startshape(dev);
startFill(dev);
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);
actions = action_GetUrl(actions, url, i->config_linktarget);
}
actions = action_End(actions);
-
- drawlink(dev, actions, 0, points,0);
+
+ drawlink(dev, actions, 0, points, 0);
}
void swfoutput_linktopage(gfxdevice_t*dev, int page, gfxline_t*points)
{
actions = action_End(actions);
}
- drawlink(dev, actions, 0, points,0);
+ drawlink(dev, actions, 0, points, 0);
}
/* Named Links (a.k.a. Acrobatmenu) are used to implement various gadgets
actions2 = action_End(actions2);
}
- drawlink(dev, actions1, actions2, points,mouseover);
+ drawlink(dev, actions1, actions2, points, mouseover);
swf_ActionFree(actions1);
swf_ActionFree(actions2);
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);
swf_ButtonPostProcess(i->tag, 1);
}
}
+ char name[80];
+ sprintf(name, "link%d", buttonid);
msg("<trace> Placing link ID %d", buttonid);
i->tag = swf_InsertTag(i->tag,ST_PLACEOBJECT2);
m = i->page_matrix;
m.tx = p.x;
m.ty = p.y;
- swf_ObjectPlace(i->tag, buttonid, getNewDepth(dev),&m,0,0);
+ swf_ObjectPlace(i->tag, buttonid, getNewDepth(dev),&m,0,name);
} else {
- swf_ObjectPlace(i->tag, buttonid, getNewDepth(dev),&i->page_matrix,0,0);
+ swf_ObjectPlace(i->tag, buttonid, getNewDepth(dev),&i->page_matrix,0,name);
}
}
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);