diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-09-23 12:41:07 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-09-23 12:41:07 +0000 |
commit | 95a3fcad380b7d7dc9a6f176bfa9c500f871a483 (patch) | |
tree | 3fff9789a32149153b2c61142be1047d189be00c /tools/source/generic | |
parent | 8725c65a9221b130f14414b9f5e059205070c6cd (diff) |
INTEGRATION: CWS sj22 (1.5.130); FILE MERGED
2005/07/20 09:59:43 sj 1.5.130.1: #i9140# rectangle needs to be justified before creating round rectangle polygon
Diffstat (limited to 'tools/source/generic')
-rw-r--r-- | tools/source/generic/poly.cxx | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 15e1880d3abd..ffbe320f8368 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -4,9 +4,9 @@ * * $RCSfile: poly.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: rt $ $Date: 2005-09-09 14:21:57 $ + * last change: $Author: hr $ $Date: 2005-09-23 13:41:07 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -472,24 +472,27 @@ Polygon::Polygon( const Rectangle& rRect, ULONG nHorzRound, ULONG nVertRound ) mpImplPolygon = (ImplPolygon*)(&aStaticImplPolygon); else { - nHorzRound = Min( nHorzRound, (ULONG) labs( rRect.GetWidth() >> 1 ) ); - nVertRound = Min( nVertRound, (ULONG) labs( rRect.GetHeight() >> 1 ) ); + Rectangle aRect( rRect ); + aRect.Justify(); // SJ: i9140 + + nHorzRound = Min( nHorzRound, (ULONG) labs( aRect.GetWidth() >> 1 ) ); + nVertRound = Min( nVertRound, (ULONG) labs( aRect.GetHeight() >> 1 ) ); if( !nHorzRound && !nVertRound ) { mpImplPolygon = new ImplPolygon( 5 ); - mpImplPolygon->mpPointAry[0] = rRect.TopLeft(); - mpImplPolygon->mpPointAry[1] = rRect.TopRight(); - mpImplPolygon->mpPointAry[2] = rRect.BottomRight(); - mpImplPolygon->mpPointAry[3] = rRect.BottomLeft(); - mpImplPolygon->mpPointAry[4] = rRect.TopLeft(); + mpImplPolygon->mpPointAry[0] = aRect.TopLeft(); + mpImplPolygon->mpPointAry[1] = aRect.TopRight(); + mpImplPolygon->mpPointAry[2] = aRect.BottomRight(); + mpImplPolygon->mpPointAry[3] = aRect.BottomLeft(); + mpImplPolygon->mpPointAry[4] = aRect.TopLeft(); } else { - const Point aTL( rRect.Left() + nHorzRound, rRect.Top() + nVertRound ); - const Point aTR( rRect.Right() - nHorzRound, rRect.Top() + nVertRound ); - const Point aBR( rRect.Right() - nHorzRound, rRect.Bottom() - nVertRound ); - const Point aBL( rRect.Left() + nHorzRound, rRect.Bottom() - nVertRound ); + const Point aTL( aRect.Left() + nHorzRound, aRect.Top() + nVertRound ); + const Point aTR( aRect.Right() - nHorzRound, aRect.Top() + nVertRound ); + const Point aBR( aRect.Right() - nHorzRound, aRect.Bottom() - nVertRound ); + const Point aBL( aRect.Left() + nHorzRound, aRect.Bottom() - nVertRound ); Polygon* pEllipsePoly = new Polygon( Point(), nHorzRound, nVertRound ); USHORT i, nEnd, nSize4 = pEllipsePoly->GetSize() >> 2; |