]> git.localhorst.tv Git - blobs.git/commitdiff
fix meter display
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 21 Nov 2017 20:53:57 +0000 (21:53 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 21 Nov 2017 20:53:57 +0000 (21:53 +0100)
oops

src/ui/widgets.cpp

index 6ce92dbc2c894d029db36c33aa6d630b7fe2e82d..49fdb69ff9048e0249b2a6621e75c724136b677b 100644 (file)
@@ -110,10 +110,12 @@ void Meter::Draw(app::Assets &assets, graphics::Viewport &viewport) noexcept {
        }
 
        if (value > 0.0f) {
+               glm::vec2 bottom_right = Position() + fullsize - glm::vec2(border) - padding;
+               bottom_right.x -= size.x * (1.0f - value);
                assets.shaders.canvas.SetColor(fill_color);
                assets.shaders.canvas.FillRect(
                        Position() + glm::vec2(border) + padding,
-                       Position() + fullsize - glm::vec2(border) - padding
+                       bottom_right
                );
        }
 }