From: Daniel Karbach Date: Tue, 21 Nov 2017 20:53:57 +0000 (+0100) Subject: fix meter display X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=bec264c34bc5c40d40aef19c2bae40d1989ed521;p=blobs.git fix meter display oops --- diff --git a/src/ui/widgets.cpp b/src/ui/widgets.cpp index 6ce92db..49fdb69 100644 --- a/src/ui/widgets.cpp +++ b/src/ui/widgets.cpp @@ -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 ); } }