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);
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);
}
}
swffont->version = 2;
swffont->name = (U8*)strdup(id);
swffont->layout = (SWFLAYOUT*)rfx_calloc(sizeof(SWFLAYOUT));
- swffont->layout->ascent = 0; /* ? */
+ swffont->layout->ascent = 0;
swffont->layout->descent = 0;
swffont->layout->leading = 0;
swffont->layout->bounds = (SRECT*)rfx_calloc(sizeof(SRECT)*font->num_glyphs);
swf_ExpandRect2(&bounds, &swffont->layout->bounds[t]);
}
- if(bounds.ymin < 0 && bounds.ymax > 0) {
- swffont->layout->ascent = -bounds.ymin;
- swffont->layout->descent = bounds.ymax;
- swffont->layout->leading = bounds.ymax - bounds.ymin;
- } else {
- swffont->layout->ascent = (bounds.ymax - bounds.ymin)/2;
- swffont->layout->descent = (bounds.ymax - bounds.ymin)/2;
- swffont->layout->leading = bounds.ymax - bounds.ymin;
- }
- swffont->layout->descent= (bounds.ymax - bounds.ymin);
- swffont->layout->ascent = 0;
+
+
+ /* Flash player will use the advance value from the char, and the ascent/descent values
+ from the layout for text selection.
+ ascent will extend the char into negative y direction, from the baseline, while descent
+ will extend in positive y direction, also from the baseline.
+ The baseline is defined as the y-position zero
+ */
+
+ swffont->layout->ascent = -bounds.ymin;
+ if(swffont->layout->ascent < 0)
+ swffont->layout->ascent = 0;
+ swffont->layout->descent = bounds.ymax;
+ if(swffont->layout->descent < 0)
+ swffont->layout->descent = 0;
swffont->layout->leading = bounds.ymax - bounds.ymin;
return swffont;