lib/cyberarm_engine/ui/element.rb in cyberarm_engine-0.16.0 vs lib/cyberarm_engine/ui/element.rb in cyberarm_engine-0.17.0
- old
+ new
@@ -224,9 +224,25 @@
def inner_height
(@style.border_thickness_top + @style.padding_top) + (@style.padding_bottom + @style.border_thickness_bottom)
end
+ def scroll_width
+ @children.sum { |c| c.width } + noncontent_width
+ end
+
+ def scroll_height
+ @children.sum { |c| c.height } + noncontent_height
+ end
+
+ def max_scroll_width
+ scroll_width - width
+ end
+
+ def max_scroll_height
+ scroll_height - height
+ end
+
def dimensional_size(size, dimension)
raise "dimension must be either :width or :height" unless %i[width height].include?(dimension)
if size && size.is_a?(Numeric)
if size.between?(0.0, 1.0)