diff --git a/JGE/include/JGui.h b/JGE/include/JGui.h index b6a901721..3221ce9af 100644 --- a/JGE/include/JGui.h +++ b/JGE/include/JGui.h @@ -58,7 +58,7 @@ public: virtual bool ButtonPressed(); // action button pressed, return false to ignore // Used for mouse support so that the GUI engine can found out which Object was selected - virtual bool getTopLeft(int& top, int& left) + virtual bool getTopLeft(float& top, float& left) { return false; } diff --git a/JGE/src/JGui.cpp b/JGE/src/JGui.cpp index 0f4f2cf6e..a27fa91fe 100644 --- a/JGE/src/JGui.cpp +++ b/JGE/src/JGui.cpp @@ -162,7 +162,7 @@ bool JGuiController::CheckUserInput(JButton key) { for (int i = 0; i < mCount; i++) { - int top, left; + float top, left; if (mObjects[i]->getTopLeft(top, left)) { distance2 = (top - y) * (top - y) + (left - x) * (left - x); diff --git a/projects/mtg/include/PlayGuiObject.h b/projects/mtg/include/PlayGuiObject.h index 5e69c8242..abbbb32d8 100644 --- a/projects/mtg/include/PlayGuiObject.h +++ b/projects/mtg/include/PlayGuiObject.h @@ -34,7 +34,7 @@ class PlayGuiObject: public JGuiObject, public JGuiListener, public Pos{ PlayGuiObject(float desiredHeight, float x, float y, bool hasFocus); PlayGuiObject(float desiredHeight, const Pos& ref, bool hasFocus); virtual void ButtonPressed(int controllerId, int controlId){}; - virtual bool getTopLeft(int& top, int& left) {top = static_cast(actY); left = static_cast(actX); return true;}; + virtual bool getTopLeft(float& top, float& left) {top = actY; left = actX; return true;}; virtual ~PlayGuiObject(){}; vector effects; }; diff --git a/projects/mtg/src/CardDisplay.cpp b/projects/mtg/src/CardDisplay.cpp index 2850835f5..b6bd3ea3d 100644 --- a/projects/mtg/src/CardDisplay.cpp +++ b/projects/mtg/src/CardDisplay.cpp @@ -105,7 +105,7 @@ bool CardDisplay::CheckUserInput(int x, int y) { for (int i = 0; i < mCount; i++) { - int top, left; + float top, left; if (mObjects[i]->getTopLeft(top, left)) { distance2 = (top - y) * (top - y) + (left - x) * (left - x);