diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2003-01-14 23:48:01 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2003-01-14 23:48:01 +0000 |
| commit | 717aa7ec8f0a0768b617def0d8dcb68069d255c4 (patch) | |
| tree | 9389a61eb11926f217551dd0903a03af2d400a44 /src | |
| parent | 9f67d66c3a7ad5fde387ecf1eb7c15d772c8e003 (diff) | |
Fix line/polygon drawing bug when the number of unique vertices is too
small.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2906 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/fl_vertex.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/fl_vertex.cxx b/src/fl_vertex.cxx index 68f90f3dc..6130520d8 100644 --- a/src/fl_vertex.cxx +++ b/src/fl_vertex.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_vertex.cxx,v 1.5.2.3.2.5 2002/01/01 15:11:32 easysw Exp $" +// "$Id: fl_vertex.cxx,v 1.5.2.3.2.6 2003/01/14 23:48:01 easysw Exp $" // // Portable drawing routines for the Fast Light Tool Kit (FLTK). // @@ -131,6 +131,10 @@ void fl_end_points() { } void fl_end_line() { + if (n < 2) { + fl_end_points(); + return; + } #ifdef WIN32 if (n>1) Polyline(fl_gc, p, n); #elif defined(__APPLE__) @@ -154,6 +158,10 @@ void fl_end_loop() { void fl_end_polygon() { fixloop(); + if (n < 3) { + fl_end_line(); + return; + } #ifdef WIN32 if (n>2) { SelectObject(fl_gc, fl_brush()); @@ -201,6 +209,10 @@ void fl_gap() { void fl_end_complex_polygon() { fl_gap(); + if (n < 3) { + fl_end_line(); + return; + } #ifdef WIN32 if (n>2) { SelectObject(fl_gc, fl_brush()); @@ -248,5 +260,5 @@ void fl_circle(double x, double y,double r) { } // -// End of "$Id: fl_vertex.cxx,v 1.5.2.3.2.5 2002/01/01 15:11:32 easysw Exp $". +// End of "$Id: fl_vertex.cxx,v 1.5.2.3.2.6 2003/01/14 23:48:01 easysw Exp $". // |
