int polygonClipSuthHodg(Point wMin, Point wMax, int n, Point* pIn, Point *pOut) { Point* first[nClip] = { 0,0,0,0 }, s[nClip]; int k, cnt = 0; for (k = 0; k < n; k++) clipPoint(pIn[k], Left, wMin, wMax, pOut, &cnt, first, s); closeClip(wMin, wMax, pOut, &cnt, first, s); return cnt; }
//----------------------------------------------------------------------- // r e n d e r //----------------------------------------------------------------------- void TGButton::render() { if(isRenderCached()) return; int x1, y1, x2, y2; TGFrameStyle fs = FS_FLAT; getBounds(x1, y1, x2, y2); if (getMouseOverControl()) fs = m_pushed?FS_LOWERED:FS_RAISED; else fs = FS_FLAT; drawFrame(x1, y1, x2, y2, fs); if (focused()) { drawOwnFocus(); } TGSBrush brush; if (m_pushed) brush = m_theme.getTextInvertedBrush(); else { if(getMouseOverControl()) brush = m_theme.getTextFocusedBrush(); else brush = m_theme.getTextBrush(); } x1 = (x2 - x1 + 1)/2 + x1; x1 -= stringWidth(m_caption)/2; x2 = 0; openClip(); drawString(x1 + x2, (y2-y1 + 1)/2 + y1 - stringHeight()/2, m_caption, brush); closeClip(); }