refactor: reduce Window references

This commit is contained in:
MihailRis
2025-04-02 14:55:53 +03:00
parent 896ab3597a
commit 74a94f869c
19 changed files with 151 additions and 155 deletions
+5 -2
View File
@@ -115,8 +115,10 @@ void GUI::actMouse(float delta) {
}
if (hover) {
hover->setHover(true);
if (Events::scroll) {
hover->scrolled(Events::scroll);
int scroll = Events::getScroll();
if (scroll) {
hover->scrolled(scroll);
}
}
this->hover = hover;
@@ -229,6 +231,7 @@ void GUI::draw(const DrawContext& pctx, const Assets& assets) {
}
menu->setPos((wsize - menu->getSize()) / 2.0f);
uicamera->setFov(wsize.y);
uicamera->setAspectRatio(viewport.getRatio());
auto uishader = assets.get<Shader>("ui");
uishader->use();