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? Manolo Feb 25, 2021  
 

On Thursday, February 25, 2021 at 12:22:06 AM UTC+1 Ian MacArthur wrote:
On 24 Feb 2021, at 20:29, Manolo wrote:
>
> On Wednesday, February 24, 2021 at 8:38:48 PM UTC+1 Ian MacArthur wrote:
>
> Neat, didn’t know that worked.
>
> Can you change the scale factor during a draw() method? I wonder if you could use this technique to, for example, have the text scale “normally” with the DPI, but force lines always to be scale 1.0, or etc...?
>
> Please, look at my example program button.cxx that does exactly this.


Yeah, sorry Manolo, I didn’t ask the question well.
What I mean is whether we can draw the text at labelsize() (when “s" is not unity) and then once the text has drawn set “s" to 1 to draw the lines.
You could remove and restore the scaling factor several times in the draw() method and thus
draw some parts with and other without scaling.


What the example does is set “s” to 1, then draw the text at (lablesize() * s) with the lines, but all with unit “s” - which has exactly the same effect I imagine, unless for some weird reason (lablesize() * s) is not the same as labelsize() at scale “s”...
Text drawing in presence of a scaling factor s is nothing but multiplying the fontsize by s and drawing text with it.
Thus, both approaches give exactly the same text, antialiasing included.

--
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/466c44cb-b8e9-4c30-9f46-042e2bcec1c3n%40googlegroups.com.
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'.