5e0d7126131a8c596306e9480d48fcfa59e4884d braney Wed Apr 10 13:51:45 2019 -0700 add postscript filled circle primitive diff --git src/lib/pscmGfx.c src/lib/pscmGfx.c index 4405e2b..9990e58 100644 --- src/lib/pscmGfx.c +++ src/lib/pscmGfx.c @@ -682,30 +682,37 @@ } void pscmLine(struct pscmGfx *pscm, int x1, int y1, int x2, int y2, int color) /* Draw a line from one point to another. */ { pscmSetColor(pscm, color); boolean fat = sameString(pscmGetHint(pscm,"fat"),"on"); if (fat) pscmFatLine(pscm, x1, y1, x2, y2); else psDrawLine(pscm->ps, x1, y1, x2, y2); boxPscm = NULL; } +void pscmCircle(struct pscmGfx *pscm, int xCen, int yCen, int rad, + Color color, boolean filled) +{ +pscmSetColor(pscm, color); +psFillCircle(pscm->ps, (double)xCen, (double)yCen, (double)rad); +} + void pscmEllipse(struct pscmGfx *pscm, int x1, int y1, int x2, int y2, Color color, int mode, boolean isDashed) /* Draw an ellipse specified as a rectangle. Args are left-most and top-most points. * Optionally draw half-ellipse (top or bottom) */ { pscmSetColor(pscm, color); if (isDashed) psSetDash(pscm->ps, TRUE); else psSetDash(pscm->ps, FALSE); int startAngle = 0; int endAngle = 360; if (mode == ELLIPSE_TOP) endAngle = 180; else if (mode == ELLIPSE_BOTTOM) @@ -753,24 +760,25 @@ vg->close = (vg_close)pscmClose; vg->dot = (vg_dot)pscmDot; vg->box = (vg_box)pscmBox; vg->line = (vg_line)pscmLine; vg->text = (vg_text)pscmText; vg->textRight = (vg_textRight)pscmTextRight; vg->textCentered = (vg_textCentered)pscmTextCentered; vg->findColorIx = (vg_findColorIx)pscmFindColorIx; vg->colorIxToRgb = (vg_colorIxToRgb)pscmColorIxToRgb; vg->setClip = (vg_setClip)pscmSetClip; vg->unclip = (vg_unclip)pscmUnclip; vg->verticalSmear = (vg_verticalSmear)pscmVerticalSmear; vg->fillUnder = (vg_fillUnder)pscmFillUnder; vg->drawPoly = (vg_drawPoly)pscmDrawPoly; vg->ellipse = (vg_ellipse)pscmEllipse; +vg->circle = (vg_circle)pscmCircle; vg->curve = (vg_curve)pscmCurve; vg->setHint = (vg_setHint)pscmSetHint; vg->getHint = (vg_getHint)pscmGetHint; vg->getFontPixelHeight = (vg_getFontPixelHeight)pscmGetFontPixelHeight; vg->getFontStringWidth = (vg_getFontStringWidth)pscmGetFontStringWidth; vg->setWriteMode = (vg_setWriteMode)pscmSetWriteMode; return vg; }