Author: greg.ercolano
Date: 2011-02-19 14:50:39 -0800 (Sat, 19 Feb 2011)
New Revision: 8450
Log:
Small mod for NULL behavior of show_item(item,yoff). (STR#2517)
Modified:
branches/branch-1.3/src/Fl_Tree.cxx
Modified: branches/branch-1.3/src/Fl_Tree.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Tree.cxx 2011-02-19 22:40:31 UTC (rev 8449)
+++ branches/branch-1.3/src/Fl_Tree.cxx 2011-02-19 22:50:39 UTC (rev 8450)
@@ -782,13 +782,14 @@
/// the value will be clipped. So if yoff=100, but scrollbar's max
/// is 50, then 50 will be used.
///
-/// \param[in] item The item to be shown. Should not be NULL.
+/// \param[in] item The item to be shown. If NULL, first() is used.
/// \param[in] yoff The pixel offset from the top for the displayed position.
///
/// \see show_item_top(), show_item_middle(), show_item_bottom()
///
void Fl_Tree::show_item(Fl_Tree_Item *item, int yoff) {
- if ( ! item ) return;
+ item = item ? item : first();
+ if (!item) return;
int newval = item->y() - y() - yoff + (int)_vscroll->value();
if ( newval < _vscroll->minimum() ) newval = (int)_vscroll->minimum();
if ( newval > _vscroll->maximum() ) newval = (int)_vscroll->maximum();
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit