diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2006-10-11 01:23:52 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2006-10-11 01:23:52 +0000 |
| commit | 367c40a9b70356764fa11cd40182a25aa6138e69 (patch) | |
| tree | 13f403d2e8e587da4efba273a4af113367180db7 | |
| parent | 09a1c11ac15edb5d956dc61733a234eff0ff3a5b (diff) | |
fl_arc() and fl_pie() did not draw properly on WIN32 when the
start and end points were identical (STR #1461)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5518 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -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; |
