summaryrefslogtreecommitdiff
path: root/src/Fl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl.cxx')
-rw-r--r--src/Fl.cxx33
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 $".
//