Skip to content

Commit

Permalink
Calculate position dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
neilsarkar committed Jul 26, 2020
1 parent 8ff88f7 commit ddcbd1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Runtime/Navigation/VioletButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void OnGUI() {
if(Event.current.type != EventType.MouseDown) { return; }

var mousePosition = Event.current.mousePosition;
mousePosition.y = 768 - mousePosition.y;
mousePosition.y = UnityEngine.Screen.height - mousePosition.y;

var rect = GetComponent<RectTransform>().rect;
var topLeft = transform.position + new Vector3(rect.xMin, rect.yMin, 0);
Expand Down

0 comments on commit ddcbd1f

Please sign in to comment.