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 11:16 AM Manolo wrote:
There's now a new public API in FLTK 1.4 to support "drawing without scaling factor", in the form of a pair of functions that remove and then restore the scaling factor:
    float fl_remove_scale();
   void fl_restore_scale(float s);

Thanks, that's great. The "naive" implementation to reset the scale didn't work well on my macOS system (I think you know why) but with the new API it works fine.

Almost. See below.

May I request to change fl_remove_scale() to fl_reset_scale() ? "Remove" sounds strange in this context.

I attach the same example program modified to use this API.

Okay, works fine on Linux (not tested elsewhere). Your program doesn't show any issues in my tests.

My own modified test program that demonstrates switching the scaling factor back and forth after drawing the box and before drawing the label fails in some situations. I attach my demo 'draw_unscaled.cxx' here. I also attach 'draw_unscaled.png' which shows a failure situation.

If there's anything wrong with my test program, please tell me. Otherwise this seems to be a bug.

What I found out with my demo: it's somehow interfering with the transient scaling factor display window when the scaling is changed (ctrl/+ or ctrl/-). I see very similar effects on macOS with cmd/+ or cmd/- but I didn't test on Windows.

Note: I used fluid/Edit/Global FLTK Settings... to enable/disable the scaling factor display. You need to restart the demo program for the change to take effect.

There are different effects depending on the appearance of the transient scaling factor display and which button has the focus:

(1) Transient scaling factor display OFF: works fine.

(2) Scaling factor display on and focus on "LABEL" button: fails almost always.

(3) scaling factor display on and focus on "no op" button: fails sumetimes but not always.

What I see is that there are two draw operations: one before the zoom factor window is shown and one after it was removed (or at least it appears so).

If I resize the window or click on another button and back on the LABEL button the redraw works fine.

Can anybody else confirm this?

--
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/c7efec52-e367-5334-03f4-cd373195dc9f%40online.de.

Attachment: draw_unscaled.png
Description: PNG image

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