diff --git a/src/graphics/ui/elements/Container.cpp b/src/graphics/ui/elements/Container.cpp index fdd0bc02..f5a6a533 100644 --- a/src/graphics/ui/elements/Container.cpp +++ b/src/graphics/ui/elements/Container.cpp @@ -95,6 +95,19 @@ void Container::draw(const DrawContext* pctx, Assets* assets) { if (node->isVisible()) node->draw(pctx, assets); } + + int diff = (actualLength-size.y); + if (scrollable && diff > 0) { + int w = 10; + int h = glm::max(size.y / actualLength * size.y, w / 2.0f); + batch->untexture(); + batch->setColor(glm::vec4(1, 1, 1, 0.5f)); + batch->rect( + pos.x + size.x - w, + pos.y - scroll / static_cast(diff) * (size.y - h), + w, h + ); + } batch->flush(); } }