diff options
author | Armin Le Grand <Armin.Le.Grand@Sun.COM> | 2010-01-27 11:51:56 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@Sun.COM> | 2010-01-27 11:51:56 +0100 |
commit | 54b1b7d41738902616ff8ed3253a4caad02736ed (patch) | |
tree | 9a75635296cfbd99c039ff1a4c5e914a564ee0f8 /basegfx | |
parent | 4ee210c72541a396f7547e8a6b2c3d6816e25626 (diff) |
aw079: #i99147# attribute rework and others
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/inc/basegfx/polygon/b2dpolygontools.hxx | 4 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolygontools.cxx | 18 |
2 files changed, 22 insertions, 0 deletions
diff --git a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx index 47ff41b75e70..cba5a4920ca2 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx @@ -274,6 +274,10 @@ namespace basegfx */ B2DPolygon createPolygonFromRect( const B2DRectangle& rRect ); + /** Create the unit polygon + */ + B2DPolygon createUnitPolygon(); + /** Create a circle polygon with given radius. This method creates a circle approximation consisting of diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index d62462b8c097..dcdaad4b5e37 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -1837,6 +1837,24 @@ namespace basegfx return aRetval; } + B2DPolygon createUnitPolygon() + { + static B2DPolygon aRetval; + + if(!aRetval.count()) + { + aRetval.append( B2DPoint( 0.0, 0.0 ) ); + aRetval.append( B2DPoint( 1.0, 0.0 ) ); + aRetval.append( B2DPoint( 1.0, 1.0 ) ); + aRetval.append( B2DPoint( 0.0, 1.0 ) ); + + // close + aRetval.setClosed( true ); + } + + return aRetval; + } + B2DPolygon createPolygonFromCircle( const B2DPoint& rCenter, double fRadius ) { return createPolygonFromEllipse( rCenter, fRadius, fRadius ); |