diff --git a/libs/kimath/include/geometry/shape_rect.h b/libs/kimath/include/geometry/shape_rect.h index 66ad12db38..0c02260706 100644 --- a/libs/kimath/include/geometry/shape_rect.h +++ b/libs/kimath/include/geometry/shape_rect.h @@ -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. */