diff --git a/AquaMai/UX/SinglePlayer.cs b/AquaMai/UX/SinglePlayer.cs index d9a5e026..f2f18ccd 100644 --- a/AquaMai/UX/SinglePlayer.cs +++ b/AquaMai/UX/SinglePlayer.cs @@ -21,12 +21,10 @@ namespace AquaMai.UX [HarmonyPrefix] [HarmonyPatch(typeof(MeshButton), "IsPointInPolygon", new Type[] { typeof(Vector2[]), typeof(Vector2) })] - public static bool IsPointInPolygon(Vector2[] polygon, ref Vector2 point) + public static bool IsPointInPolygon(Vector2[] polygon, ref Vector2 point, MeshButton __instance, ref bool __result) { - var screenWidth = Screen.width; - point = new Vector2(point.x - (screenWidth / 2), point.y); - - return true; + __result = RectTransformUtility.RectangleContainsScreenPoint(__instance.GetComponent(), point, Camera.main); + return false; } } -} +} \ No newline at end of file