summaryrefslogtreecommitdiff
path: root/src/fl_draw_arrow.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2022-11-23 15:17:43 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2022-11-23 15:21:34 +0100
commit5e4643621b252c36f2cd04bbb066dcae596473bb (patch)
treed2b017bfa2f7a55955b5c816a75c5b8977394229 /src/fl_draw_arrow.cxx
parentbd18d9de2666c3feb394aeaa529a5334690f84b2 (diff)
Save and restore current color when drawing arrows
Make sure we don't change the current color after we finish drawing.
Diffstat (limited to 'src/fl_draw_arrow.cxx')
-rw-r--r--src/fl_draw_arrow.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fl_draw_arrow.cxx b/src/fl_draw_arrow.cxx
index 2aef43889..0bee12226 100644
--- a/src/fl_draw_arrow.cxx
+++ b/src/fl_draw_arrow.cxx
@@ -220,6 +220,8 @@ static int fl_draw_arrow_choice(Fl_Rect r, Fl_Color col) {
void fl_draw_arrow(Fl_Rect r, Fl_Arrow_Type t, Fl_Orientation o, Fl_Color col) {
int ret = 0;
+ Fl_Color saved_color = fl_color();
+
debug_arrow(r);
// implementation of all arrow types
@@ -253,4 +255,6 @@ void fl_draw_arrow(Fl_Rect r, Fl_Arrow_Type t, Fl_Orientation o, Fl_Color col) {
fl_line(r.x(), r.b(), r.r(), r.y());
}
+ fl_color(saved_color);
+
} // fl_draw_arrow()