FLTK logo

Re: [RFE] STR #3533: Fl_Counter with fixed arrow widths - preliminary code sample

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

Re: [RFE] STR #3533: Fl_Counter with fixed arrow widths - preliminary code sample Albrecht Schlosser Nov 21, 2020  
 
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: https://www.fltk.org/str.php?L3533
Version: 1.3-feature


Nicholas, thank you very much for your kind words. It's a pleasure to read
that one's work is appreciated. WRT Alfred North Whitehead: interesting
person...

My current work is not primarily about drawing arrows, although my
intention is always to "do it right". This includes of course also drawing
correct arrow symbols. The reason why it takes so long to complete this
easy looking task goes much deeper into the FLTK library. It's basically
(bad) coding technique that drew my attention: we're having all sorts of
arrow drawing code in different widgets, some are using FLTK symbols, some
are differentiating by the current FLTK scheme, and last but not least,
it's all redundant code which is error prone. You can find lots of code
like

  if (Fl::is_scheme("<name>")) { ... }

in the FLTK library. This is a maintenance nightmare and it makes creation
of new FLTK "schemes" incredibly and unnecessarily difficult, not only WRT
arrow drawing code but much more. My vision is to move all this
scheme-dependent code from the widget implementations to a base class
Fl_Scheme and derived classes. I did already implement parts of this but
got blocked/distracted by other work. My current work is, as you may
notice, refactoring of "arrow drawing" functions by always calling
fl_draw_arrow(...) with appropriate arguments. This function will
eventually be integrated in the Fl_Scheme class hierarchy by calling
virtual methods that do the scheme specific stuff. The first step is done
and I'm currently working on fixing some issues, reimplementing more widget
specific code, and also improving the final "arrow drawing" function(s).
I'm not yet fully satisfied with the API and some scaling details but I'm
making progress. My plan is to commit this new function and whatever is
needed soon w/o the final Fl_Scheme class. Stay tuned...

For now I can post another screenshot (arrows-standard.png), as previously
announced also with Fl_Spinner using the new drawing code. This time I used
the default scheme ("none") w/o scaling (1.0 or 100%). As you can see when
you zoom into the image all arrow borders are horizontal, vertical, or
other multiples of 45° and draw nicely w/o unexpected artifacts (except
the normal "steps"). The resolution is lower, as expected.


Link: https://www.fltk.org/str.php?L3533
Version: 1.3-feature


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'.