- // If radius is zero use DrawRectangle() instead to avoid
- // X drawing errors with small radii
- if (rd == 0)
- {
- DrawRectangle( x, y, width, height );
- return;
- }
-
- // Draw nothing if transformed w or h is 0
- if (wd == 0 || hd == 0) return;
-
- // CMB: adjust size if outline is drawn otherwise the result is
- // 1 pixel too wide and high
- if (m_pen.GetStyle() != wxTRANSPARENT)
- {
- wd--;
- hd--;
- }
-
- // CMB: ensure dd is not larger than rectangle otherwise we
- // get an hour glass shape
- if (rw_d > wd) rw_d = wd;
- if (rw_d > hd) rw_d = hd;
- rd = rw_d / 2;
-
- // For backing pixmap
- int xd2 = XLOG2DEV_2 (x);
- int yd2 = YLOG2DEV_2 (y);
- int rd2 = XLOG2DEVREL ((long) radius);
- int wd2 = XLOG2DEVREL (width) ;
- int hd2 = YLOG2DEVREL (height) ;
-
- int rw_d2 = rd2 * 2;
- int rh_d2 = rw_d2;
-
- if (m_brush.Ok() && m_brush.GetStyle () != wxTRANSPARENT)
- {
- SetBrush (m_brush);
-
- XFillRectangle ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + rd, yd,
- wd - rw_d, hd);
- XFillRectangle ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd + rd,
- wd, hd - rh_d);
-
- // Arcs start from 3 o'clock, positive angles anticlockwise
- // Top-left
- XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd,
- rw_d, rh_d, 90 * 64, 90 * 64);
- // Top-right
- XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + wd - rw_d, yd,
-// rw_d, rh_d, 0, 90 * 64);
- rw_d, rh_d, 0, 91 * 64);
- // Bottom-right
- XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + wd - rw_d,
- yd + hd - rh_d,
-// rw_d, rh_d, 270 * 64, 90 * 64);
- rw_d, rh_d, 269 * 64, 92 * 64);
- // Bottom-left
- XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd + hd - rh_d,
- rw_d, rh_d, 180 * 64, 90 * 64);
-
- if (m_window && m_window->GetBackingPixmap())