FLTK logo

[master] 5e46436 - Save and restore current color when drawing arrows

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 5e46436 - Save and restore current color when drawing arrows "Albrecht Schlosser" Nov 23, 2022  
 
commit 5e4643621b252c36f2cd04bbb066dcae596473bb
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Wed Nov 23 15:17:43 2022 +0100
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Wed Nov 23 15:21:34 2022 +0100

    Save and restore current color when drawing arrows
    
    Make sure we don't change the current color after we finish drawing.

 src/fl_draw_arrow.cxx | 4 ++++
 1 file changed, 4 insertions(+)

diff --git src/fl_draw_arrow.cxx src/fl_draw_arrow.cxx
index 2aef438..0bee122 100644
--- src/fl_draw_arrow.cxx
+++ 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()
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.