From 2f6a0233b16d25df9b79a61b93fd8a72626bad3c Mon Sep 17 00:00:00 2001 From: nathansmith117 Date: Wed, 21 Feb 2024 11:17:41 -0700 Subject: Fixed mouse position with render texture --- src/ui.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ui.c') diff --git a/src/ui.c b/src/ui.c index f07dc96..5fab8a6 100644 --- a/src/ui.c +++ b/src/ui.c @@ -1,5 +1,6 @@ #include "ui.h" #include "game.h" +#include "util.h" TexturedButton createTexturedButton(Texture* texture, Rectangle rect, const char* message, Color backgroundColor, Color foregroundColor) @@ -46,7 +47,7 @@ bool updateTexturedButton(TexturedButton* button) button->isPressed = false; // Outline and detect click stuff. - if (CheckCollisionPointRec(GetMousePosition(), button->rect)) + if (CheckCollisionPointRec(getScaledMousePosition(), button->rect)) { // Draw outline thingy. if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) -- cgit v1.2.3