return num;
}
+void gfxdraw_conicTo(gfxdrawer_t*draw, double cx, double cy, double tox, double toy)
+{
+ double c1x = (draw->x + 2 * cx) / 3;
+ double c1y = (draw->y + 2 * cy) / 3;
+ double c2x = (2 * cx + tox) / 3;
+ double c2y = (2 * cy + toy) / 3;
+ gfxdraw_cubicTo(draw, c1x, c1y, c2x, c2y, tox, toy);
+}
+
+
void gfxdraw_cubicTo(gfxdrawer_t*draw, double c1x, double c1y, double c2x, double c2y, double x, double y)
{
qspline_t q[128];
num = approximate3(&c, q, 128, maxerror*maxerror);
for(t=0;t<num;t++) {
- FPOINT mid;
- FPOINT to;
+ gfxpoint_t mid;
+ gfxpoint_t to;
mid.x = q[t].control.x;
mid.y = q[t].control.y;
to.x = q[t].end.x;
gfxbbox_t gfxbbox_expand_to_point(gfxbbox_t box, gfxcoord_t x, gfxcoord_t y)
{
- if(box.xmin==0 || box.ymin==0 || box.xmax==0 || box.ymax==0) {
+ if(box.xmin==0 && box.ymin==0 && box.xmax==0 && box.ymax==0) {
box.xmin = x;
box.ymin = y;
box.xmax = x;
last = 0;
}
x = line->x;
- y = line->x;
+ y = line->y;
line = line->next;
}
return bbox;