diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2022-11-20 14:11:19 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2022-11-20 14:11:19 +0100 |
| commit | be928430a6cc642b82bc1dfe6a94823ae0dd5016 (patch) | |
| tree | 99ce8a1eefd47433a9f676c7fbccf245d3385a13 /src/Fl_Scroll.cxx | |
| parent | 8a53fc96117de38cc63515ff2e94d435184dbe9e (diff) | |
Fix Fl_Group::insert() and Fl_Scroll::on_move()
Diffstat (limited to 'src/Fl_Scroll.cxx')
| -rw-r--r-- | src/Fl_Scroll.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx index fd7f4fbae..bee0d7120 100644 --- a/src/Fl_Scroll.cxx +++ b/src/Fl_Scroll.cxx @@ -113,13 +113,12 @@ int Fl_Scroll::on_insert(Fl_Widget *candidate, int index) { Fl_Group calls this when a widget is moved within the list of children. We return a new index if the widget would be moved after the scrollbars. - \param oldIndex the current index of the child that will be moved - \param newIndex the new index of the child + \param old_index the current index of the child that will be moved + \param new_index the new index of the child \return new index, possibly corrected to avoid last two scrollbar entries */ -int Fl_Scroll::on_move(int oldIndex, int newIndex) { - // Compensate index for the widget that will be removed before it re-inserted - return on_insert( child(oldIndex), newIndex+1 ) - 1; +int Fl_Scroll::on_move(int old_index, int new_index) { + return on_insert(child(old_index), new_index); } /** |
