/* * Creates a shape filled with bitmap */ SWFShape newSWFShapeFromBitmap(SWFBitmap bitmap, int flag) { SWFShape shape = newSWFShape(); SWFFillStyle fill; int width, height; if ( flag != SWFFILL_TILED_BITMAP && flag != SWFFILL_CLIPPED_BITMAP) { SWF_error("Invalid bitmap fill flag"); } fill = SWFShape_addBitmapFillStyle(shape, bitmap, flag); width = SWFBitmap_getWidth(bitmap); height = SWFBitmap_getHeight(bitmap); SWFShape_setRightFillStyle(shape, fill); // XXX - scale shouldn't be hardcoded! (here, or in newSWFBitmapFillStyle) SWFShape_drawScaledLine(shape, width * 20, 0); SWFShape_drawScaledLine(shape, 0, height * 20); SWFShape_drawScaledLine(shape, -width * 20, 0); SWFShape_drawScaledLine(shape, 0, -height * 20); return shape; }
void SWFShape_drawLine(SWFShape shape, float dx, float dy) { SWFShape_drawScaledLine(shape, (int)rint(dx*Ming_scale), (int)rint(dy*Ming_scale)); }
void SWFShape_drawLine(SWFShape shape, double dx, double dy) { SWFShape_drawScaledLine(shape, (int)rint(dx*Ming_scale), (int)rint(dy*Ming_scale)); }
/* x,y relative to shape origin */ void SWFShape_drawScaledLineTo(SWFShape shape, int x, int y) { SWFShape_drawScaledLine(shape, x-shape->xpos, y-shape->ypos); }