Fixed an issue where system view elements could render outside the designated area.

This commit is contained in:
Leon Styhre 2022-09-12 19:06:09 +02:00
parent 8d5dc46fc6
commit ab5af86f7e

View file

@ -163,10 +163,18 @@ void SystemView::render(const glm::mat4& parentTrans)
renderElements(parentTrans, false);
glm::mat4 trans {getTransform() * parentTrans};
// Make sure nothing renders outside our designated area.
mRenderer->pushClipRect(
glm::ivec2 {static_cast<int>(std::round(trans[3].x)),
static_cast<int>(std::round(trans[3].y))},
glm::ivec2 {static_cast<int>(std::round(mSize.x)), static_cast<int>(std::round(mSize.y))});
mPrimary->render(trans);
if (!fade || mLegacyMode)
renderElements(parentTrans, true);
mRenderer->popClipRect();
}
void SystemView::onThemeChanged(const std::shared_ptr<ThemeData>& /*theme*/)