diff options
author | Pierre Ossman <ossman@cendio.se> | 2023-07-14 13:10:27 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2023-07-14 14:16:50 +0200 |
commit | efbe273c11e0b236f03e095c7701172148d909e8 (patch) | |
tree | 2134e100127268a7f26d3a4a3be44fa65c49e44c /vncviewer/fltk | |
parent | 8109d90c1b917308fb725e132c181a898a026700 (diff) | |
download | tigervnc-efbe273c11e0b236f03e095c7701172148d909e8.tar.gz tigervnc-efbe273c11e0b236f03e095c7701172148d909e8.zip |
Workaround for broken fl_arc()/fl_pie()
There is something broken with these FLTK draw routines on Windows. They
leave gaps at the start and end of the arc/pie rather than filling the
whole specified span. So we need to nudge the numbers a bit to work
around this.
Diffstat (limited to 'vncviewer/fltk')
-rw-r--r-- | vncviewer/fltk/theme.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vncviewer/fltk/theme.cxx b/vncviewer/fltk/theme.cxx index 1a6345b2..2c45c734 100644 --- a/vncviewer/fltk/theme.cxx +++ b/vncviewer/fltk/theme.cxx @@ -42,6 +42,31 @@ const int RADIUS = 4; +/* + * fl_arc() and fl_pie() are broken on Windows, so we need to fudge the + * numbers a bit + */ +#ifdef WIN32 +static void fixed_arc(int x,int y,int w,int h,double a1,double a2) { + if ((a1 != 0.0) || (a2 != 360.0)) { + a1 -= 10.0; + a2 += 10.0; + } + fl_arc(x, y, w, h, a1, a2); +} + +static void fixed_pie(int x,int y,int w,int h,double a1,double a2) { + if ((a1 != 0.0) || (a2 != 360.0)) { + a1 -= 10.0; + a2 += 10.0; + } + fl_pie(x, y, w, h, a1, a2); +} + +#define fl_arc fixed_arc +#define fl_pie fixed_pie +#endif + static Fl_Color light_border(Fl_Color c) { return fl_color_average(FL_BLACK, c, 0.12); |