From a2d44ea2dcca1f7b39434ddfa77b556f44663aa8 Mon Sep 17 00:00:00 2001 From: Cyberarm Date: Mon, 2 Jan 2023 16:45:43 -0600 Subject: [PATCH] Fix Element#scroll_height not accounting for padding_top and border_thickness_top --- lib/cyberarm_engine/ui/element.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cyberarm_engine/ui/element.rb b/lib/cyberarm_engine/ui/element.rb index 4a884e0..3b3dce9 100644 --- a/lib/cyberarm_engine/ui/element.rb +++ b/lib/cyberarm_engine/ui/element.rb @@ -423,9 +423,9 @@ module CyberarmEngine pairs_ << a_ unless pairs_.last == a_ - pairs_.sum { |pair| pair.map(&:outer_height).max } + @style.padding_bottom + @style.border_thickness_bottom + pairs_.sum { |pair| + @style.padding_top + @style.border_thickness_top + pair.map(&:outer_height).max } + @style.padding_bottom + @style.border_thickness_bottom else - @children.sum(&:outer_height) + @style.padding_bottom + @style.border_thickness_bottom + @style.padding_top + @style.border_thickness_top + @children.sum(&:outer_height) + @style.padding_bottom + @style.border_thickness_bottom end end