geometry: constructor for SHAPE_RECT from a BOX2

This commit is contained in:
Tomasz Wlostowski 2022-02-24 00:09:20 +01:00
parent 7e8f14e738
commit 2746be30c1
1 changed files with 10 additions and 0 deletions

View File

@ -46,6 +46,16 @@ public:
m_h( 0 )
{}
/**
* Create a rectangle defined by a BOX2.
*/
SHAPE_RECT( const BOX2I& aBox ) :
SHAPE( SH_RECT ),
m_p0( aBox.GetPosition() ),
m_w( aBox.GetWidth() ),
m_h( aBox.GetHeight() )
{}
/**
* Create a rectangle defined by top-left corner (aX0, aY0), width aW and height aH.
*/