Fix UI focus

This commit is contained in:
MrLetsplay 2023-10-15 21:35:56 +02:00
parent 4222f4eb14
commit c6232b7691
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg

View File

@ -69,7 +69,9 @@ static void doUIMouseClick(double x, double y, GLFWMouseButton button) {
clickedElement->clickAll(clickedAt, UIPoint((int) x, (int) y), button); clickedElement->clickAll(clickedAt, UIPoint((int) x, (int) y), button);
if(button == GLFWMouseButton::LEFT) { if(button == GLFWMouseButton::LEFT) {
clickedElement->focusEnterAll(clickedAt, UIPoint((int) x, (int) y)); if(!clickedElement->focusEnterAll(clickedAt, UIPoint((int) x, (int) y))) {
UI::unfocusElement(kekData.ui->focusedElement);
}
} }
} else { } else {
UI::unfocusElement(kekData.ui->focusedElement); UI::unfocusElement(kekData.ui->focusedElement);