From 346dc5b0cb8752f97bba7ad6138733ee9338da2b Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Thu, 9 May 2019 22:07:15 -0500 Subject: [PATCH] Fixed page buttons' hitboxes --- BSIPA-ModList/UI/ViewControllers/MarkdownView.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs b/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs index c7c74ead..e991b07a 100644 --- a/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs +++ b/BSIPA-ModList/UI/ViewControllers/MarkdownView.cs @@ -131,7 +131,11 @@ namespace BSIPA_ModList.UI.ViewControllers pup_rt.anchoredPosition = new Vector2(pup_xoff, pup_rt.anchoredPosition.y); var pup_bg_rt = pup_rt.Find("BG") as RectTransform; pup_bg_rt.sizeDelta = new Vector2(pup_bg_rt.sizeDelta.y, pup_bg_rt.sizeDelta.y); - //Destroy(pageUp.GetComponent()); // destroy Touchable component to fix hitboxes + + // fix hitbox + pup_rt.anchorMin = new Vector2(.5f, pup_rt.anchorMin.y); + pup_rt.anchorMax = new Vector2(.5f, pup_rt.anchorMax.y); + pup_rt.sizeDelta = new Vector2(pup_rt.sizeDelta.y, pup_rt.sizeDelta.y); } { var pdn_rt = pageDown.transform as RectTransform; @@ -140,7 +144,11 @@ namespace BSIPA_ModList.UI.ViewControllers pdn_rt.anchoredPosition = new Vector2(pdn_xoff, pdn_rt.anchoredPosition.y); var pdn_bg_rt = pdn_rt.Find("BG") as RectTransform; pdn_bg_rt.sizeDelta = new Vector2(pdn_bg_rt.sizeDelta.y, pdn_bg_rt.sizeDelta.y); - //Destroy(pageDown.GetComponent()); // destroy Touchable component to fix hitboxes + + // fix hitbox + pdn_rt.anchorMin = new Vector2(.5f, pdn_rt.anchorMin.y); + pdn_rt.anchorMax = new Vector2(.5f, pdn_rt.anchorMax.y); + pdn_rt.sizeDelta = new Vector2(pdn_rt.sizeDelta.y, pdn_rt.sizeDelta.y); } scrView = gameObject.AddComponent();