Added a new getRatingValue function to RatingComponent.

This commit is contained in:
Leon Styhre 2022-01-22 21:25:35 +01:00
parent 487422454e
commit a147c87cea
2 changed files with 8 additions and 0 deletions

View file

@ -75,6 +75,13 @@ std::string RatingComponent::getValue() const
return ss.str();
}
std::string RatingComponent::getRatingValue() const
{
std::stringstream ss;
ss << mValue * NUM_RATING_STARS;
return ss.str();
}
void RatingComponent::setOpacity(unsigned char opacity)
{
mOpacity = opacity;

View file

@ -23,6 +23,7 @@ public:
RatingComponent(bool colorizeChanges = false);
std::string getValue() const override;
std::string getRatingValue() const;
// Should be a normalized float (in the range [0..1]) - if it's not, it will be clamped.
void setValue(const std::string& value) override;