diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-12-19 21:42:22 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-12-19 21:42:22 +0000 |
| commit | d64d3a55a8b4ebc6d4053921376c7541a78e3d15 (patch) | |
| tree | 37f198a6b22fda3efe659d48eb26af3ef5339020 | |
| parent | 74d47ce80c68cff16554a37e554bcb6df9ff3728 (diff) | |
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
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | src/Fl_Scroll.cxx | 18 |
2 files changed, 16 insertions, 4 deletions
@@ -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 diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx index 22593c146..28633dae5 100644 --- a/src/Fl_Scroll.cxx +++ b/src/Fl_Scroll.cxx @@ -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 $". // |
