Skip to content

Commit

Permalink
update BitmapText to v1.1.5
Browse files Browse the repository at this point in the history
fixes some basic code issues including missing variables.
also uses sf::Vector2<std::size_t> instead of the 2u variety (unsigned int) since other inputs are std::size_t.
  • Loading branch information
Hapaxia committed Jan 23, 2025
1 parent 1f018a3 commit 2d90ad6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/SelbaWard/BitmapText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void BitmapText::setScale(const std::size_t scale)
setScale(scale, scale);
}

void BitmapText::setScale(const sf::Vector2u scale)
void BitmapText::setScale(const sf::Vector2<std::size_t> scale)
{
this->Transformable::setScale(sf::Vector2f(scale));
}
Expand Down Expand Up @@ -185,10 +185,10 @@ void BitmapText::priv_updateVertices()

priv_updateColor();

m_bounds.position.x = minX;
m_bounds.position.y = minY;
m_bounds.size.x = maxX - minX;
m_bounds.size.y = maxY - minY;
m_bounds.position.x = min.x;
m_bounds.position.y = min.y;
m_bounds.size.x = max.x - min.x;
m_bounds.size.y = max.y - min.y;
}

void BitmapText::priv_updateColor()
Expand Down
4 changes: 2 additions & 2 deletions src/SelbaWard/BitmapText.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
namespace selbaward
{

// SW Bitmap Text v1.1.4
// SW Bitmap Text v1.1.5
class BitmapText : public sf::Drawable, public sf::Transformable
{
public:
Expand All @@ -55,7 +55,7 @@ class BitmapText : public sf::Drawable, public sf::Transformable
const sf::Color getColor() const;
void setScale(std::size_t scale);
void setScale(std::size_t scaleX, std::size_t scaleY);
void setScale(sf::Vector2u scale);
void setScale(sf::Vector2<std::size_t> scale);
sf::FloatRect getGlobalBounds() const;
sf::FloatRect getLocalBounds() const;

Expand Down

0 comments on commit 2d90ad6

Please sign in to comment.