static void PostDraw(void *p, VG_View *vv) { VG_TextTool *t = p; int x, y; VG_GetViewCoords(vv, VGTOOL(t)->vCursor, &x,&y); AG_DrawCircle(vv, x,y, 3, VG_MapColorRGB(vv->vg->selectionColor)); }
static void Draw(void *p, VG_View *vv) { VG_Circle *vc = p; VG_Vector vCenter = VG_Pos(vc->p); int x, y, r; VG_GetViewCoords(vv, vCenter, &x, &y); r = (int)(vc->r*vv->scale); AG_DrawCircle(vv, x, y, r, VG_MapColorRGB(VGNODE(vc)->color)); }
static void RenderText(VG_Text *vt, char *sIn, VG_View *vv) { char sSubst[VG_TEXT_MAX], *s; VG_Vector v1, v2, vMid; int x, y; int su; if (vt->vsObj != NULL) { AG_VariableSubst(vt->vsObj, sIn, sSubst, sizeof(sSubst)); s = sSubst; } else { s = sIn; } AG_PushTextState(); if (vt->fontFace[0] != '\0' && ((agGUI && vt->fontSize != (int)agDefaultFont->spec.size) || (agGUI && vt->fontFlags != agDefaultFont->flags))) { AG_TextFontLookup(vt->fontFace, vt->fontSize, vt->fontFlags); } AG_TextColor(VG_MapColorRGB(VGNODE(vt)->color)); v1 = VG_Pos(vt->p1); v2 = VG_Pos(vt->p2); vMid.x = v1.x + (v2.x - v1.x)/2.0f; vMid.y = v1.y + (v2.y - v1.y)/2.0f; VG_GetViewCoords(vv, vMid, &x, &y); if ((su = AG_TextCacheGet(vv->tCache, s)) != -1) { VG_DrawSurface(vv, x, y, VG_Degrees(VG_Atan2(v1.y-v2.y, v1.x-v2.x)), su); } AG_PopTextState(); }