summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-12-17 15:01:38 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-12-17 15:01:38 +0000
commitb5a99aa15679f11d2cfb3c7290c611b7fe26e6ec (patch)
tree16640097922bfdaa2bb4e95a628c79a9a6033326
parent5dd762509295268a7d6c825bbd02161c461f5569 (diff)
Only use clipping box if it is valid.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1862 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES4
-rw-r--r--src/Fl_Text_Display.cxx20
2 files changed, 16 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES
index 391847406..0359c9de4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
CHANGES IN FLTK 1.1.0b8
+ - Fl_Text_Display could get in an infinite loop when
+ redrawing a portion of the screen. Added a check for
+ the return value from fl_clip_box() so that the
+ correct bounding box is used.
- Removed the Fl_Mutex and Fl_Signal_Mutex classes from
the threads example, since they weren't being used
and apparently are not very portable.
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 2bb26c5e5..b6eabfb8b 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Text_Display.cxx,v 1.12.2.7 2001/12/08 20:46:33 easysw Exp $"
+// "$Id: Fl_Text_Display.cxx,v 1.12.2.8 2001/12/17 15:01:38 easysw Exp $"
//
// Copyright Mark Edel. Permission to distribute under the LGPL for
// the FLTK library granted by Mark Edel.
@@ -1804,14 +1804,18 @@ void Fl_Text_Display::draw(void) {
if (damage() & (FL_DAMAGE_ALL | FL_DAMAGE_EXPOSE)) {
//printf("drawing all text\n");
int X, Y, W, H;
- fl_clip_box(text_area.x, text_area.y,
- text_area.w, text_area.h,
- X, Y, W, H);
- draw_text(X, Y, W, H); // this sets the clipping internally
-
- // draw some lines of text
+ if (fl_clip_box(text_area.x, text_area.y, text_area.w, text_area.h,
+ X, Y, W, H)) {
+ // Draw text using the intersected clipping box...
+ // (this sets the clipping internally)
+ draw_text(X, Y, W, H);
+ } else {
+ // Draw the whole area...
+ draw_text(text_area.x, text_area.y, text_area.w, text_area.h);
+ }
}
else if (damage() & FL_DAMAGE_SCROLL) {
+ // draw some lines of text
fl_push_clip(text_area.x, text_area.y,
text_area.w, text_area.h);
//printf("drawing text from %d to %d\n", damage_range1_start, damage_range1_end);
@@ -1956,5 +1960,5 @@ int Fl_Text_Display::handle(int event) {
//
-// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.7 2001/12/08 20:46:33 easysw Exp $".
+// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.8 2001/12/17 15:01:38 easysw Exp $".
//