From b7e58c09fffb66553ecde90ff7fd08d37055fb6d Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 16 Mar 2023 21:45:07 +0700 Subject: [PATCH] Fix RectangleButtonPanel adding extra space when not required --- .../screen/panels/button/BooleanRectangleButtonPanel.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/button/BooleanRectangleButtonPanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/button/BooleanRectangleButtonPanel.kt index 9c5f2fbc7..2afbdf2fd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/button/BooleanRectangleButtonPanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/button/BooleanRectangleButtonPanel.kt @@ -44,10 +44,14 @@ abstract class BooleanRectangleButtonPanel( if (tooltipList != null) { tooltips.addAll(tooltipList) - tooltips.add(SPACE) + + if (tooltipActive != null || tooltipInactive != null) + tooltips.add(SPACE) } else if (tooltip != null) { tooltips.add(tooltip) - tooltips.add(SPACE) + + if (tooltipActive != null || tooltipInactive != null) + tooltips.add(SPACE) } if (tooltipActive != null) {