From 3ee8864bfc2badfc6f5dfcd09616eff9c7b2e708 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 6 Oct 2021 18:35:00 +0200 Subject: Simplify and fix the code of Fl_Scroll::bbox() Declare Fl_Scroll::bbox() and Fl_Scroll::recalc_scrollbars() 'const'. These methods don't change the Fl_Scroll widget. Use Fl_Scroll::recalc_scrollbars() in Fl_Scroll::bbox() to simplify the code and to avoid code duplication. bbox() can now be called at any time and returns the correct values, no matter if draw() has been called before. --- FL/Fl_Scroll.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'FL/Fl_Scroll.H') diff --git a/FL/Fl_Scroll.H b/FL/Fl_Scroll.H index 35fcf9a24..ce2ff14f9 100644 --- a/FL/Fl_Scroll.H +++ b/FL/Fl_Scroll.H @@ -130,11 +130,11 @@ protected: // (STR#1895) Fl_Scrollbar_Data hscroll; ///< horizontal scrollbar region + values Fl_Scrollbar_Data vscroll; ///< vertical scrollbar region + values } ScrollInfo; - void recalc_scrollbars(ScrollInfo &si); + void recalc_scrollbars(ScrollInfo &si) const; protected: - void bbox(int&,int&,int&,int&); + void bbox(int&,int&,int&,int&) const; void draw(); public: -- cgit v1.2.3