FLTK logo

Re: [fltk/fltk] Fl::visible_focus(false) causes artifacts in some widgets when redrawn (#263)

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.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] Fl::visible_focus(false) causes artifacts in some widgets when redrawn (#263) Albrecht Schlosser Jul 25, 2021  
 

Thanks for the report, this is a known issue caused by multiple drawing of antialiased text in the same place, but it's a more general problem than only in such buttons. It happens for instance if any label is drawn inside a box with no solid background. As your patch shows, this can (partially) be worked around by searching up the widget hierarchy to find a box (widget) with a solid background and damage() that widget by calling redraw(). But even that will not always cover the entire label (e.g. if the label is large and/or crosses box boundaries).

However this might not be the most optimal solution.

Unfortunately this is more than true. For one this could result in redrawing the entire window as the result of a button click which is really bad (performance wise), but another important issue is that testing for FL_NO_BOX is not enough. There are other boxtypes (all the FL_*_FRAME types) that don't have a solid background, and labels can be drawn outside the widget's own box etc.. Furthermore we don't have a box type attribute that would say: "this box type has a solid background" (or not).

That said, there's (currently) no other solution than using a boxtype with a solid background. If you add

  btn.box(FL_FLAT_BOX);

to the test program the issue goes away.

The fact that this happens or not whether you change Fl::visible_focus() is only a side effect and doesn't help solving the root cause.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]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'.