add doc comment to box scale functions

This commit is contained in:
ohsqueezy 2023-09-04 16:31:10 -04:00
parent 081328e63d
commit c0fe0c782d
2 changed files with 19 additions and 6 deletions

View File

@ -419,8 +419,6 @@ void Box::clear()
h = 0;
}
/* Scale the box by multiplying size by {delta.x, delta.y}. If preserve center is set, the box will be scaled
* around the center, otherwise the top left corner will remain in place. */
void Box::scale(glm::vec2 delta, bool preserve_center)
{
glm::vec2 center = this->center();
@ -431,8 +429,6 @@ void Box::scale(glm::vec2 delta, bool preserve_center)
}
}
/* Scale the box by multiplying both width and height by delta. If preserve center is set, the box will be scaled
* around the center, otherwise the top left corner will remain in place. */
void Box::scale(float delta, bool preserve_center)
{
scale({delta, delta}, preserve_center);

View File

@ -137,8 +137,25 @@ public:
void center(const glm::vec2&);
operator SDL_Rect() const;
void clear();
void scale(glm::vec2, bool = false);
void scale(float, bool = false);
/*!
* Scale the box by multiplying size by {delta.x, delta.y}. If preserve center is set, the box will be scaled
* around the center, otherwise the top left corner will remain in place.
*
* @param delta amount to scale
* @param preserve_center after scaling, move the box so the center is the same as it was before scaling
*/
void scale(glm::vec2 delta, bool preserve_center = false);
/*!
* Scale the box by multiplying both width and height by delta. If preserve center is set, the box will be scaled
* around the center, otherwise the top left corner will remain in place.
*
* @param delta amount to scale
* @param preserve_center after scaling, move the box so the center is the same as it was before scaling
*/
void scale(float delta, bool preserve_center = false);
void expand(glm::vec2, bool = false);
void expand(float, bool = false);
void move(const glm::vec2&);