Fix Fl_Scroll handling of widgets whose labels are to the right or below.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2882 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2002-12-19 21:42:22 +00:00
parent 74d47ce80c
commit d64d3a55a8
2 changed files with 16 additions and 4 deletions

View File

@ -1,6 +1,8 @@
CHANGES IN FLTK 1.1.3
- Documentation updates.
- Fl_Scroll didn't compute the location of labels to the
right or below when determining the area to erase.
- Added backward-compatibility macro for
filename_setext().
- Fl_Bitmap::copy(), Fl_Pixmap::copy(), and

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.2 2002/08/09 22:57:00 easysw Exp $"
// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.3 2002/12/19 21:42:22 easysw Exp $"
//
// Scroll widget for the Fast Light Tool Kit (FLTK).
//
@ -50,10 +50,20 @@ void Fl_Scroll::draw_clip(void* v,int X, int Y, int W, int H) {
int R = X; int B = Y; // track bottom & right edge of all children
for (int i=s->children()-2; i--;) {
Fl_Widget& o = **a++;
int NR, NB;
s->draw_child(o);
s->draw_outside_label(o);
if (o.x()+o.w() > R) R = o.x()+o.w();
if (o.y()+o.h() > B) B = o.y()+o.h();
NR = o.x()+o.w();
NB = o.y()+o.h();
if ((o.align() & (FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT)) &&
!(o.align() & FL_ALIGN_INSIDE)) {
int LW = 0, LH = 0;
o.measure_label(LW, LH);
if (o.align() & FL_ALIGN_BOTTOM) NB += LH;
else NR += LW;
}
if (NR > R) R = NR;
if (NB > B) B = NB;
}
// fill any area to right & bottom of widgets:
if (R < X+W && B > Y) {
@ -248,5 +258,5 @@ int Fl_Scroll::handle(int event) {
}
//
// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.2 2002/08/09 22:57:00 easysw Exp $".
// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.3 2002/12/19 21:42:22 easysw Exp $".
//