From 38d40365f8d69cc6e60842a71011a184a8fca37e Mon Sep 17 00:00:00 2001 From: DieSkaarj <40402624+DieSkaarj@users.noreply.github.com> Date: Sun, 6 Nov 2022 17:34:42 +0000 Subject: Check for child visibility in Fl_Scroll (#432) Calculate scroll area only according to visible children. Note: "visible" means in this context: "not hidden" - as opposed to being invisible because the widget doesn't have a background and a label. --- src/Fl_Scroll.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx index ae7a76e54..f218915a8 100644 --- a/src/Fl_Scroll.cxx +++ b/src/Fl_Scroll.cxx @@ -206,7 +206,7 @@ void Fl_Scroll::recalc_scrollbars(ScrollInfo &si) const { Fl_Widget*const* a = array(); for (int i=children(); i--;) { Fl_Widget* o = *a++; - if ( o==&scrollbar || o==&hscrollbar ) continue; + if ( o==&scrollbar || o==&hscrollbar || o->visible()==0 ) continue; if ( first ) { first = 0; si.child.l = o->x(); -- cgit v1.2.3