diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-03-11 16:05:20 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-03-11 16:05:32 +0100 |
| commit | 569fec25e0454c4e4b98dcc383143a357ca50b55 (patch) | |
| tree | c38048366a56a901a66465fdaca6628d0e03405a /src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx | |
| parent | bd6c9854342094e2de8183aaab740804c1a6fc1f (diff) | |
Unification of scaled coordinate calculations in class Fl_Scalable_Graphics_Driver
Most coordinate calculations are done with the new inline function
int Fl_Scalable_Graphics_Driver::floor(int coord)
that is used by both the Windows and X11 platforms.
Diffstat (limited to 'src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx')
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx index 9bd3aaa44..32a5c1689 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx @@ -30,8 +30,9 @@ #include <FL/math.h> #include <FL/platform.H> -void Fl_GDI_Graphics_Driver::arc_unscaled(float x, float y, float w, float h, double a1, double a2) { +void Fl_GDI_Graphics_Driver::arc_unscaled(int x, int y, int w, int h, double a1, double a2) { if (w <= 0 || h <= 0) return; + w++; h++; int xa = int( x+w/2+int(w*cos(a1/180.0*M_PI)) ); int ya = int( y+h/2-int(h*sin(a1/180.0*M_PI)) ); int xb = int( x+w/2+int(w*cos(a2/180.0*M_PI)) ); @@ -42,9 +43,11 @@ void Fl_GDI_Graphics_Driver::arc_unscaled(float x, float y, float w, float h, do } else Arc(gc_, int(x), int(y), int(x+w), int(y+h), xa, ya, xb, yb); } -void Fl_GDI_Graphics_Driver::pie_unscaled(float x, float y, float w, float h, double a1, double a2) { +void Fl_GDI_Graphics_Driver::pie_unscaled(int x, int y, int w, int h, double a1, double a2) { if (w <= 0 || h <= 0) return; if (a1 == a2) return; + x++; y++; w--; h--; + if (scale() >= 3) {x++; y++; w-=2; h-=2;} int xa = int( x+w/2+int(w*cos(a1/180.0*M_PI)) ); int ya = int( y+h/2-int(h*sin(a1/180.0*M_PI)) ); int xb = int( x+w/2+int(w*cos(a2/180.0*M_PI)) ); |
