mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Added getPosition() and getSize() to sf::Rect<T>.
This commit is contained in:
parent
27a4c83ebc
commit
ca21695521
@ -151,6 +151,26 @@ public:
|
||||
////////////////////////////////////////////////////////////
|
||||
bool intersects(const Rect<T>& rectangle, Rect<T>& intersection) const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the position of the rectangle's top-left corner
|
||||
///
|
||||
/// \return Position of rectangle
|
||||
///
|
||||
/// \see getSize
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
sf::Vector2<T> getPosition() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the size of the rectangle
|
||||
///
|
||||
/// \return Size of rectangle
|
||||
///
|
||||
/// \see getPosition
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
sf::Vector2<T> getSize() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Member data
|
||||
////////////////////////////////////////////////////////////
|
||||
|
@ -141,6 +141,18 @@ bool Rect<T>::intersects(const Rect<T>& rectangle, Rect<T>& intersection) const
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
sf::Vector2<T> Rect<T>::getPosition() const
|
||||
{
|
||||
return sf::Vector2<T>(left, top);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
sf::Vector2<T> Rect<T>::getSize() const
|
||||
{
|
||||
return sf::Vector2<T>(width, height);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
template <typename T>
|
||||
|
Loading…
Reference in New Issue
Block a user