mirror of
https://github.com/SFML/SFML.git
synced 2025-01-18 23:35:11 +08:00
Fix sf::Rect
docs
This commit is contained in:
parent
9cb4a68c9a
commit
ec50a7332b
@ -214,7 +214,7 @@ using FloatRect = Rect<float>;
|
||||
/// Usage example:
|
||||
/// \code
|
||||
/// // Define a rectangle, located at (0, 0) with a size of 20x5
|
||||
/// sf::IntRect r1(0, 0, 20, 5);
|
||||
/// sf::IntRect r1({0, 0}, {20, 5});
|
||||
///
|
||||
/// // Define another rectangle, located at (4, 2) with a size of 18x10
|
||||
/// sf::Vector2i position(4, 2);
|
||||
@ -222,8 +222,8 @@ using FloatRect = Rect<float>;
|
||||
/// sf::IntRect r2(position, size);
|
||||
///
|
||||
/// // Test intersections with the point (3, 1)
|
||||
/// bool b1 = r1.contains(3, 1); // true
|
||||
/// bool b2 = r2.contains(3, 1); // false
|
||||
/// bool b1 = r1.contains({3, 1}); // true
|
||||
/// bool b2 = r2.contains({3, 1}); // false
|
||||
///
|
||||
/// // Test the intersection between r1 and r2
|
||||
/// std::optional<sf::IntRect> result = r1.findIntersection(r2);
|
||||
|
Loading…
Reference in New Issue
Block a user