minor refactor

This commit is contained in:
MihailRis
2024-12-05 19:18:53 +03:00
parent 69779f0cc0
commit 04b6b6b546
29 changed files with 130 additions and 91 deletions
+2 -2
View File
@@ -13,12 +13,12 @@ CheckBox::CheckBox(bool checked) : UINode(glm::vec2(32.0f)), checked(checked) {
setHoverColor({0.05f, 0.1f, 0.2f, 0.75f});
}
void CheckBox::draw(const DrawContext* pctx, Assets*) {
void CheckBox::draw(const DrawContext& pctx, const Assets&) {
if (supplier) {
checked = supplier();
}
glm::vec2 pos = calcPos();
auto batch = pctx->getBatch2D();
auto batch = pctx.getBatch2D();
batch->texture(nullptr);
batch->setColor(checked ? checkColor : calcColor());
batch->rect(pos.x, pos.y, size.x, size.y);