diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-12-17 15:01:38 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-12-17 15:01:38 +0000 |
| commit | b5a99aa15679f11d2cfb3c7290c611b7fe26e6ec (patch) | |
| tree | 16640097922bfdaa2bb4e95a628c79a9a6033326 /src | |
| parent | 5dd762509295268a7d6c825bbd02161c461f5569 (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
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Text_Display.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
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 $". // |
