corrected minimap coordinate placement

This commit is contained in:
devZoGok
2024-09-26 19:42:22 +03:00
parent eab534d305
commit ab06ead0d5
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -20,8 +20,8 @@ namespace battleship{
void MinimapButton::onClick(){
Vector2 clickPos = getCursorPos();
float posXRatio = 1. - (clickPos.x - pos.x) / size.x;
float posYRatio = 1. - (clickPos.y - pos.y) / size.y;
float posXRatio = (clickPos.x - pos.x) / size.x;
float posYRatio = (clickPos.y - pos.y) / size.y;
Camera *cam = Root::getSingleton()->getCamera();
Vector3 mapSize = Map::getSingleton()->getMapSize();