Avoid size recalculation if Fl_Browser::textsize() didn't change.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11464 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2016-03-29 11:34:10 +00:00
parent 474db7e1ff
commit 11322ede59
2 changed files with 6 additions and 1 deletions

View File

@ -3,7 +3,7 @@
//
// Common browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this

View File

@ -657,6 +657,9 @@ int Fl_Browser::topline() const {
internally for optimization of later item changes. This can be slow
if there are many items in the browser.
It returns immediately (w/o recalculation) if \p newSize equals
the current textsize().
You \e may need to call redraw() to see the effect and to have the
scrollbar positions recalculated.
@ -664,6 +667,8 @@ int Fl_Browser::topline() const {
unless you really need to \e change the size later.
*/
void Fl_Browser::textsize(Fl_Fontsize newSize) {
if (newSize == textsize())
return; // avoid recalculation
Fl_Browser_::textsize(newSize);
new_list();
full_height_ = 0;