diff --git a/docs/user/interface/Region.dox b/docs/user/interface/Region.dox index 4162a08943..738fb8a04c 100644 --- a/docs/user/interface/Region.dox +++ b/docs/user/interface/Region.dox @@ -332,6 +332,29 @@ */ +/*! + \fn void BRegion::ScaleBy(BSize scale) + \brief Resize each of the contained rectangles by the given factor + and recalculates the region's bounds. + + \param scale The scale factor + + \since Haiku R1 +*/ + + +/*! + \fn void BRegion::ScaleBy(float x, float y) + \brief Resize each of the contained rectangles by the given factors + and recalculates the region's bounds. + + \param x The horizontal scale. + \param y The vertical scale. + + \since Haiku R1 +*/ + + /*! \fn void BRegion::MakeEmpty() \brief Empties the region so that it doesn't containt any rects, and diff --git a/headers/os/interface/Region.h b/headers/os/interface/Region.h index 07ad81e348..b5e729004d 100644 --- a/headers/os/interface/Region.h +++ b/headers/os/interface/Region.h @@ -59,6 +59,7 @@ public: void OffsetBy(const BPoint& point); void OffsetBy(int32 x, int32 y); + void ScaleBy(BSize scale); void ScaleBy(float x, float y); void MakeEmpty(); diff --git a/src/kits/interface/Region.cpp b/src/kits/interface/Region.cpp index 1ce133c8e9..e5b77d4025 100644 --- a/src/kits/interface/Region.cpp +++ b/src/kits/interface/Region.cpp @@ -306,6 +306,13 @@ BRegion::OffsetBy(int32 x, int32 y) } +void +BRegion::ScaleBy(BSize scale) +{ + ScaleBy(scale.Width(), scale.Height()); +} + + void BRegion::ScaleBy(float x, float y) {