mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-26 13:06:13 +01:00
Added GetLocalBounds and GetGlobalBounds functions to drawable classes
This commit is contained in:
1 parent
441703a997
commit
cc8d8ed07b
10 files changed
+320
No files matched your search
@@ -304,3 +304,35 @@ void sfConvexShape_SetPoint(sfConvexShape* shape, unsigned int index, float x, f
|
||||
{
|
||||
CSFML_CALL(shape, SetPoint(index, sf::Vector2f(x, y)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfConvexShape_GetLocalBounds(const sfConvexShape* shape)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = shape->This.GetLocalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfConvexShape_GetGlobalBounds(const sfConvexShape* shape)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = shape->This.GetGlobalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
Reference in new issue
Block a user