diff --git a/src/common/graphcmn.cpp b/src/common/graphcmn.cpp index 8c74fa3727..0d3d777601 100644 --- a/src/common/graphcmn.cpp +++ b/src/common/graphcmn.cpp @@ -436,6 +436,9 @@ void wxGraphicsPathData::AddRoundedRectangle( wxDouble x, wxDouble y, wxDouble w AddRectangle(x,y,w,h); else { + wxDouble maxR = std::min(w, h) / 2.0; + if ( radius > maxR ) radius = maxR; + MoveToPoint(x+w, y+h/2); AddArc(x+w-radius, y+h-radius, radius, 0.0, M_PI/2.0, true); AddArc(x+radius, y+h-radius, radius, M_PI/2.0, M_PI, true); diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index f02997977d..d0ff97cd49 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -864,6 +864,9 @@ void wxWindowDCImpl::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width if (radius < 0.0) radius = - radius * ((width < height) ? width : height); + wxDouble maxR = std::min(width, height) / 2.0; + if ( radius > maxR ) radius = maxR; + wxCoord xx = XLOG2DEV(x); wxCoord yy = YLOG2DEV(y); wxCoord ww = m_signX * XLOG2DEVREL(width);