From a5ae7d54a6aa1101d1695621136cb06402bd76ef Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Fri, 30 Jun 2000 04:23:13 +0000 Subject: Fix suggested by Stuart Levy to fix scrolling when deleting items from the browser. I replaced the -$(MAKEFLAGS) with $(MFLAGS) as per the gmake documenation. Apperntly this works with other make programs and MAKEFLAGS is passed invisibly by gmake, though the documenation is not too clear... VS: ---------------------------------------------------------------------- git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1245 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Browser_.cxx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/Fl_Browser_.cxx b/src/Fl_Browser_.cxx index 31f6ab885..4df4d7d15 100644 --- a/src/Fl_Browser_.cxx +++ b/src/Fl_Browser_.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Browser_.cxx,v 1.10.2.13 2000/06/05 21:20:48 mike Exp $" +// "$Id: Fl_Browser_.cxx,v 1.10.2.14 2000/06/30 04:23:13 spitzak Exp $" // // Base Browser widget class for the Fast Light Tool Kit (FLTK). // @@ -397,14 +397,20 @@ void Fl_Browser_::new_list() { // Tell it that this item is going away, and that this must remove // all pointers to it: void Fl_Browser_::deleting(void* l) { - if (displayed(l)) redraw_lines(); - if (l == selection_) selection_ = 0; - if (l == top_) { - real_position_ -= offset_; - offset_ = 0; - top_ = item_next(l); - if (!top_) top_ = item_prev(l); + if (displayed(l)) { + redraw_lines(); + if (l == top_) { + real_position_ -= offset_; + offset_ = 0; + top_ = item_next(l); + if (!top_) top_ = item_prev(l); + } + } else { + // we don't know where this item is, recalculate top... + real_position_ = 0; + top_ = 0; } + if (l == selection_) selection_ = 0; if (l == max_width_item) {max_width_item = 0; max_width = 0;} } @@ -700,5 +706,5 @@ void Fl_Browser_::item_select(void*, int) {} int Fl_Browser_::item_selected(void* l) const {return l==selection_;} // -// End of "$Id: Fl_Browser_.cxx,v 1.10.2.13 2000/06/05 21:20:48 mike Exp $". +// End of "$Id: Fl_Browser_.cxx,v 1.10.2.14 2000/06/30 04:23:13 spitzak Exp $". // -- cgit v1.2.3