aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/RoundedRectangle.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/RoundedRectangle.cpp b/src/RoundedRectangle.cpp
index 5baeac6..735c182 100644
--- a/src/RoundedRectangle.cpp
+++ b/src/RoundedRectangle.cpp
@@ -12,8 +12,9 @@ namespace QuickMedia {
vertices[1].texCoords = sf::Vector2f(1.0f, 0.0f);
vertices[2].texCoords = sf::Vector2f(1.0f, 1.0f);
vertices[3].texCoords = sf::Vector2f(0.0f, 1.0f);
- set_color(color);
- set_size(size);
+
+ for(size_t i = 0; i < 4; ++i)
+ vertices[i].color = color;
const sf::Color shadow_color(0, 0, 0, 50);
@@ -49,7 +50,6 @@ namespace QuickMedia {
vertices[2].position = pos + sf::Vector2f(size.x, size.y);
vertices[3].position = pos + sf::Vector2f(0.0f, size.y);
- const sf::Color shadow_color(0, 0, 0, 100);
const float shadow_radius = 5.0f;
// Top
@@ -83,10 +83,8 @@ namespace QuickMedia {
}
void RoundedRectangle::set_color(sf::Color color) {
- vertices[0].color = color;
- vertices[1].color = color;
- vertices[2].color = color;
- vertices[3].color = color;
+ for(size_t i = 0; i < 4; ++i)
+ vertices[i].color = color;
}
sf::Vector2f RoundedRectangle::get_position() const {