diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-06-02 17:52:36 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-06-02 17:52:36 +0000 |
| commit | 839dfca77853da7ee76e585e9044e5bbf63a678f (patch) | |
| tree | 99df2d1a5b4f88df71473d97bff1162434ddfb33 /src/Fl.cxx | |
| parent | 9671c0429064f38e70ba1e441cd6ec071f310b3a (diff) | |
Redraw fixes.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2276 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl.cxx')
| -rw-r--r-- | src/Fl.cxx | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 75a410194..d24ec7505 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl.cxx,v 1.24.2.41.2.33 2002/05/23 16:47:41 easysw Exp $" +// "$Id: Fl.cxx,v 1.24.2.41.2.34 2002/06/02 17:52:36 easysw Exp $" // // Main event handling code for the Fast Light Tool Kit (FLTK). // @@ -824,7 +824,34 @@ void Fl::paste(Fl_Widget &receiver) { #include <FL/fl_draw.H> -void Fl_Widget::redraw() {damage(FL_DAMAGE_ALL);} +void Fl_Widget::redraw() { + if (box() == FL_NO_BOX) { + // Widgets with the FL_NO_BOX boxtype need a parent to + // redraw, since it is responsible for redrawing the + // background... + int X = x() > 0 ? x() - 1 : 0; + int Y = y() > 0 ? y() - 1 : 0; + window()->damage(FL_DAMAGE_ALL, X, Y, w() + 2, h() + 2); + } + else damage(FL_DAMAGE_ALL); + + if (window() && align() && !(align() & FL_ALIGN_INSIDE)) { + // If the label is not inside the widget, compute the location of + // the label and redraw the window within that bounding box... + int W = 0, H = 0; + label_.measure(W, H); + + if (align() & FL_ALIGN_BOTTOM) { + window()->damage(FL_DAMAGE_ALL, x(), y() + h(), w(), H); + } else if (align() & FL_ALIGN_TOP) { + window()->damage(FL_DAMAGE_ALL, x(), y() - H, w(), H); + } else if (align() & FL_ALIGN_LEFT) { + window()->damage(FL_DAMAGE_ALL, x() - W, y(), W, h()); + } else if (align() & FL_ALIGN_RIGHT) { + window()->damage(FL_DAMAGE_ALL, x() + w(), y(), W, h()); + } + } +} void Fl_Widget::damage(uchar flags) { if (type() < FL_WINDOW) { @@ -901,5 +928,5 @@ void Fl_Window::flush() { } // -// End of "$Id: Fl.cxx,v 1.24.2.41.2.33 2002/05/23 16:47:41 easysw Exp $". +// End of "$Id: Fl.cxx,v 1.24.2.41.2.34 2002/06/02 17:52:36 easysw Exp $". // |
