FLTK logo

Re: [fltk.general] Re: Can custom box type functions handle their own high-DPI screen scaling?

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

Re: Re: Can custom box type functions handle their own high-DPI screen scaling? Albrecht Schlosser Feb 25, 2021  
 
On 2/25/21 3:54 PM Manolo wrote:

On Thursday, February 25, 2021 at 1:57:34 PM UTC+1 Albrecht Schlosser wrote:

    If there's anything wrong with my test program, please tell me.

Yes. There is. That program assumes the font face and size are correctly set when fl_text_extents() is called. But that's not the case at the very beginning of the draw() method.

If you add
     fl_font(labelfont(), labelsize());
just before
     fl_text_extents(label(), dx, dy, ll, lh);
all runs smoothly.

Ooh, what a silly mistake, sorry for the noise. I had copied things around and obviously deleted that line.

Works now, as you say. Thanks for the correction.

The transient window display lets the font size to large values which produce erroneously large colored boxes later.

Yep, that explains it very well.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/5d22c61e-f4b3-4ec2-ea84-bc1270afdc14%40online.de.
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'.