From 69805e2026b62b34163968cfecef5b22194f851d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Torres?= Date: Sun, 21 Jun 2020 02:00:38 -0300 Subject: [PATCH] Fix for tree rect overlapping top bar on the main tab when UI scale is set to 2x and above on high-DPI displays. --- Source/MainTabWindow_ResearchTree.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/MainTabWindow_ResearchTree.cs b/Source/MainTabWindow_ResearchTree.cs index 59dff8b..ecccd1a 100644 --- a/Source/MainTabWindow_ResearchTree.cs +++ b/Source/MainTabWindow_ResearchTree.cs @@ -150,11 +150,10 @@ private void SetRects() { // tree view rects, have to deal with UIScale and ZoomLevel manually. _baseViewRect = new Rect( - StandardMargin / Prefs.UIScale, - ( TopBarHeight + Constants.Margin + StandardMargin ) / Prefs.UIScale, - ( Screen.width - StandardMargin * 2f ) / Prefs.UIScale, - ( Screen.height - MainButtonDef.ButtonHeight - StandardMargin * 2f - TopBarHeight - Constants.Margin ) / - Prefs.UIScale ); + StandardMargin / Prefs.UIScale, + (TopBarHeight + Constants.Margin + StandardMargin), + (Screen.width - StandardMargin * 2f) / Prefs.UIScale, + ((Screen.height - MainButtonDef.ButtonHeight - StandardMargin * 2) / Prefs.UIScale) - TopBarHeight - Constants.Margin); _baseViewRect_Inner = _baseViewRect.ContractedBy( Constants.Margin / Prefs.UIScale ); // windowrect, set to topleft (for some reason vanilla alignment overlaps bottom buttons).