Skip to content

Commit

Permalink
Clarified semantics of Shape::getGlobalBounds(), improved related doc…
Browse files Browse the repository at this point in the history
…umentation
  • Loading branch information
Bromeon committed May 3, 2015
1 parent 93f389e commit 947427c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/SFML/Graphics/Image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class SFML_GRAPHICS_API Image
/// \param destX X coordinate of the destination position
/// \param destY Y coordinate of the destination position
/// \param sourceRect Sub-rectangle of the source image to copy
/// \param applyAlpha Should the copy take in account the source transparency?
/// \param applyAlpha Should the copy take into account the source transparency?
///
////////////////////////////////////////////////////////////
void copy(const Image& source, unsigned int destX, unsigned int destY, const IntRect& sourceRect = IntRect(0, 0, 0, 0), bool applyAlpha = false);
Expand Down
13 changes: 10 additions & 3 deletions include/SFML/Graphics/Shape.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,20 @@ class SFML_GRAPHICS_API Shape : public Drawable, public Transformable
FloatRect getLocalBounds() const;

////////////////////////////////////////////////////////////
/// \brief Get the global bounding rectangle of the entity
/// \brief Get the global (non-minimal) bounding rectangle of the entity
///
/// The returned rectangle is in global coordinates, which means
/// that it takes in account the transformations (translation,
/// that it takes into account the transformations (translation,
/// rotation, scale, ...) that are applied to the entity.
/// In other words, this function returns the bounds of the
/// sprite in the global 2D world's coordinate system.
/// shape in the global 2D world's coordinate system.
///
/// This function does not necessarily return the \a minimal
/// bounding rectangle. It merely ensures that the returned
/// rectangle covers all the vertices (but possibly more).
/// This allows for a fast approximation of the bounds as a
/// first check; you may want to use more precise checks
/// on top of that.
///
/// \return Global bounding rectangle of the entity
///
Expand Down
2 changes: 1 addition & 1 deletion include/SFML/Graphics/Sprite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class SFML_GRAPHICS_API Sprite : public Drawable, public Transformable
/// \brief Get the global bounding rectangle of the entity
///
/// The returned rectangle is in global coordinates, which means
/// that it takes in account the transformations (translation,
/// that it takes into account the transformations (translation,
/// rotation, scale, ...) that are applied to the entity.
/// In other words, this function returns the bounds of the
/// sprite in the global 2D world's coordinate system.
Expand Down
4 changes: 2 additions & 2 deletions include/SFML/Graphics/Text.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ class SFML_GRAPHICS_API Text : public Drawable, public Transformable
/// \brief Get the global bounding rectangle of the entity
///
/// The returned rectangle is in global coordinates, which means
/// that it takes in account the transformations (translation,
/// that it takes into account the transformations (translation,
/// rotation, scale, ...) that are applied to the entity.
/// In other words, this function returns the bounds of the
/// sprite in the global 2D world's coordinate system.
/// text in the global 2D world's coordinate system.
///
/// \return Global bounding rectangle of the entity
///
Expand Down
4 changes: 2 additions & 2 deletions include/SFML/Graphics/VertexArray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ class SFML_GRAPHICS_API VertexArray : public Drawable
////////////////////////////////////////////////////////////
/// \brief Compute the bounding rectangle of the vertex array
///
/// This function returns the axis-aligned rectangle that
/// contains all the vertices of the array.
/// This function returns the minimal axis-aligned rectangle
/// that contains all the vertices of the array.
///
/// \return Bounding rectangle of the vertex array
///
Expand Down
2 changes: 1 addition & 1 deletion include/SFML/Window/Sensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class SFML_WINDOW_API Sensor
///
/// You may wonder why some sensor types look so similar, for example
/// Accelerometer and Gravity / UserAcceleration. The first one
/// is the raw measurement of the acceleration, and takes in account
/// is the raw measurement of the acceleration, and takes into account
/// both the earth gravity and the user movement. The others are
/// more precise: they provide these components separately, which is
/// usually more useful. In fact they are not direct sensors, they
Expand Down

0 comments on commit 947427c

Please sign in to comment.