diff options
| -rw-r--r-- | CHANGES | 3 | ||||
| -rw-r--r-- | src/fl_arci.cxx | 19 |
2 files changed, 17 insertions, 5 deletions
@@ -1,5 +1,8 @@ CHANGES IN FLTK 1.1.8 + - fl_arc() and fl_pie() did not draw properly on WIN32 + when the start and end points were identical (STR + #1461) - Fl_Input and Fl_Text_Editor now hide the mouse pointer when typing into them (STR #1466) - Implemented alpha blending for Quartz, WIN32, and X11 diff --git a/src/fl_arci.cxx b/src/fl_arci.cxx index 8a91b5776..69b6ef1f9 100644 --- a/src/fl_arci.cxx +++ b/src/fl_arci.cxx @@ -3,7 +3,7 @@ // // Arc (integer) drawing functions for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2005 by Bill Spitzak and others. +// Copyright 1998-2006 by Bill Spitzak and others. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public @@ -38,10 +38,10 @@ #include <FL/fl_draw.H> #include <FL/x.H> #ifdef WIN32 -#include <FL/math.h> +# include <FL/math.h> #endif #ifdef __APPLE__ -#include <config.h> +# include <config.h> #endif void fl_arc(int x,int y,int w,int h,double a1,double a2) { @@ -51,7 +51,10 @@ void fl_arc(int x,int y,int w,int h,double a1,double a2) { int ya = y+h/2-int(h*sin(a1/180.0*M_PI)); int xb = x+w/2+int(w*cos(a2/180.0*M_PI)); int yb = y+h/2-int(h*sin(a2/180.0*M_PI)); - Arc(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb); + if (fabs(a1 - a2) < 90) { + if (xa == xb && ya == yb) SetPixel(fl_gc, xa, ya, fl_RGB()); + else Arc(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb); + } else Arc(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb); #elif defined(__APPLE_QD__) Rect r; r.left=x; r.right=x+w; r.top=y; r.bottom=y+h; a1 = a2-a1; a2 = 450-a2; @@ -84,7 +87,13 @@ void fl_pie(int x,int y,int w,int h,double a1,double a2) { int xb = x+w/2+int(w*cos(a2/180.0*M_PI)); int yb = y+h/2-int(h*sin(a2/180.0*M_PI)); SelectObject(fl_gc, fl_brush()); - Pie(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb); + if (fabs(a1 - a2) < 90) { + if (xa == xb && ya == yb) { + MoveToEx(fl_gc, x+w/2, y+h/2, 0L); + LineTo(fl_gc, xa, ya); + SetPixel(fl_gc, xa, ya, fl_RGB()); + } else Pie(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb); + } else Pie(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb); #elif defined(__APPLE_QD__) Rect r; r.left=x; r.right=x+w; r.top=y; r.bottom=y+h; a1 = a2-a1; a2 = 450-a2; |
