From 43998972cf586d7c06169015a0946bf76901b0c4 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 14 Mar 2020 13:21:51 -0400 Subject: [PATCH] panelcomponent: fix removing final gap from total width/height --- .../client/ui/overlay/components/PanelComponent.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/PanelComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/PanelComponent.java index 0d81a5bf18..5fb373621c 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/PanelComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/PanelComponent.java @@ -163,8 +163,14 @@ public class PanelComponent implements LayoutableRenderableEntity } // Remove last child gap - totalWidth -= gap.x; - totalHeight -= gap.y; + if (orientation == ComponentOrientation.HORIZONTAL) + { + totalWidth -= gap.x; + } + else // VERTICAL + { + totalHeight -= gap.y; + } // Cache children bounds childDimensions.setSize(totalWidth, totalHeight);