diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H | 1 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx | 4 | ||||
| -rw-r--r-- | src/fl_symbols.cxx | 11 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H index 899d39819..016ace499 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H @@ -193,6 +193,7 @@ protected: void end_loop(); void end_polygon(); void end_complex_polygon(); + bool can_fill_non_convex_polygon(); void gap(); virtual void ellipse_unscaled(double xt, double yt, double rx, double ry); virtual void arc_unscaled(int x, int y, int w, int h, double a1, double a2); diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx index 3b43a360a..1b6e7b430 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx @@ -76,6 +76,10 @@ void Fl_Xlib_Graphics_Driver::end_complex_polygon() { if (n>2) XFillPolygon(fl_display, fl_window, gc_, short_point, n, 0, 0); } +bool Fl_Xlib_Graphics_Driver::can_fill_non_convex_polygon() { + return false; +} + // shortcut the closed circles so they use XDrawArc: // warning: these do not draw rotated ellipses correctly! // See fl_arc.c for portable version. diff --git a/src/fl_symbols.cxx b/src/fl_symbols.cxx index 2f86c2394..e6ebb4199 100644 --- a/src/fl_symbols.cxx +++ b/src/fl_symbols.cxx @@ -238,8 +238,15 @@ static void draw_search(Fl_Color col) static void draw_arrow1(Fl_Color col) { fl_color(col); - BP; vv(-0.8,-0.4); vv(-0.8,0.4); vv(0.0,0.4); vv(0.0,-0.4); EP; - BP; vv(0.0,0.8); vv(0.8,0.0); vv(0.0,-0.8); vv(0.0,-0.4); vv(0.0,0.4); EP; + if (fl_graphics_driver->can_fill_non_convex_polygon()) { + // draw the arrow as a 7-vertex filled polygon + BP; vv(-0.8,-0.4); vv(-0.8,0.4); vv(0.0,0.4); vv(0.0,0.8); vv(0.8,0.0); + vv(0.0,-0.8); vv(0.0,-0.4); EP; + } else { + // draw the arrow as a rectangle plus a triangle + BP; vv(-0.8,-0.4); vv(-0.8,0.4); vv(0.0,0.4); vv(0.0,-0.4); EP; + BP; vv(0.0,0.8); vv(0.8,0.0); vv(0.0,-0.8); vv(0.0,-0.4); vv(0.0,0.4); EP; + } set_outline_color(col); BC; vv(-0.8,-0.4); vv(-0.8,0.4); vv(0.0,0.4); vv(0.0,0.8); vv(0.8,0.0); vv(0.0,-0.8); vv(0.0,-0.4); EC; |
