slight optimization

This commit is contained in:
Jorijn van der Graaf 2025-11-25 02:10:18 +01:00
commit 4793d6f26a
6 changed files with 39 additions and 25 deletions

View file

@ -40,18 +40,4 @@ UiElementMouse::UiElementMouse(std::int_fast32_t anchorX, std::int_fast32_t anch
UiElementBuffer::UiElementBuffer(std::uint_fast32_t width, std::uint_fast32_t height) : width(width), height(height) {
}
void UiElement::UpdatePosition(WindowFramebuffer& window) {
window.ScaleElement(transform);
for(UiElement* child : children) {
child->UpdatePosition(window, *this);
}
}
void UiElement::UpdatePosition(WindowFramebuffer& window, UiElement& parent) {
window.ScaleElement(transform, parent.transform);
for(UiElement* child : children) {
UpdatePosition(window, *child);
}
}