static void ming_ellipse(GVJ_t * job, pointf * A, int filled) { SWFMovie movie = (SWFMovie)(job->context); SWFShape shape; SWFFill fill; SWFDisplayItem item; obj_state_t *obj = job->obj; gvcolor_t pencolor = obj->pencolor; gvcolor_t fillcolor = obj->fillcolor; double rx, ry; shape = newSWFShape(); SWFShape_setLine(shape, obj->penwidth, pencolor.u.rgba[0], pencolor.u.rgba[1], pencolor.u.rgba[2], pencolor.u.rgba[3]); if (filled) { fill = SWFShape_addSolidFill(shape, fillcolor.u.rgba[0], fillcolor.u.rgba[1], fillcolor.u.rgba[2], fillcolor.u.rgba[3]); SWFShape_setRightFill(shape, fill); } SWFShape_movePenTo(shape, 0, 0); rx = A[1].x - A[0].x; ry = A[1].y - A[0].y; SWFShape_drawCircle(shape, rx); item = SWFMovie_add(movie, (SWFBlock)shape); SWFDisplayItem_scale(item, 1., ry/rx); SWFDisplayItem_moveTo(item, A[0].x, A[0].y); }
static VALUE draw_circle(VALUE self, VALUE r) { SWFShape shape; Data_Get_Struct(self, struct SWFShape_s, shape); SWFShape_drawCircle(shape, NUM2DBL(r)); return self; }
void swfCircle(double x, double y, double r, const pGEcontext gc, pDevDesc dd) { #ifdef SWF_DEBUG Rprintf("circle called\n"); #endif pswfDesc swfInfo = (pswfDesc) dd->deviceSpecific; SWFShape shape = newSWFShape(); swfSetLineStyle(shape, gc, swfInfo); swfSetFillStyle(shape, gc, swfInfo); SWFShape_movePenTo(shape, x, y); SWFShape_drawCircle(shape, r); SWFShape_end(shape); SWFMovieClip_add(swfInfo->currentFrame, (SWFBlock) shape); }
EXPORT BOOL WINAPI s_drawCircle(int r, int p2, int p3, int p4) { lstrcpy(funcname, "s_drawCircle"); SWFShape_drawCircle(mhsp_shape, r); return 0; }