Merge commit 'refs/pull/24327/head' of github.com:wxWidgets/wxWidgets
Limit radius of rounded rectangles in graphics rendering. See #24327.
This commit is contained in:
commit
ccd6971552
2 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue