FLTK logo

[master] 88a3f7b - Rename fl_remove_scale() to fl_override_scale() as discussed in fltk.general

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.commit  ]
 
Previous Message ]Next Message ]

[master] 88a3f7b - Rename fl_remove_scale() to fl_override_scale() as discussed in fltk.general "ManoloFLTK" Feb 26, 2021  
 
commit 88a3f7b7be1110e0d4a8587e48f4ad24fe527646
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Sat Feb 27 08:18:01 2021 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Sat Feb 27 08:18:01 2021 +0100

    Rename fl_remove_scale() to fl_override_scale() as discussed in fltk.general
    
    Re: Can custom box type functions handle their own high-DPI screen scaling?

 FL/Fl_Graphics_Driver.H                          | 4 ++--
 FL/fl_draw.H                                     | 2 +-
 src/Fl_Graphics_Driver.cxx                       | 4 ++--
 src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H   | 2 +-
 src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx | 2 +-
 src/fl_draw.cxx                                  | 8 ++++----
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git FL/Fl_Graphics_Driver.H FL/Fl_Graphics_Driver.H
index fdebd1d..3bce25f 100644
--- FL/Fl_Graphics_Driver.H
+++ FL/Fl_Graphics_Driver.H
@@ -364,7 +364,7 @@ public:
   virtual void font_name(int num, const char *name);
   // Defaut implementation may be enough
   virtual void overlay_rect(int x, int y, int w , int h);
-  virtual float remove_scale();
+  virtual float override_scale();
   virtual void restore_scale(float);
 };
 
@@ -488,7 +488,7 @@ protected:
   void transformed_vertex(double xf, double yf);
   virtual void transformed_vertex0(float x, float y);
   void vertex(double x, double y);
-  virtual float remove_scale();
+  virtual float override_scale();
   virtual void restore_scale(float);
 };
 #endif // FL_DOXYGEN
diff --git FL/fl_draw.H FL/fl_draw.H
index 58168a0..30f5cfe 100644
--- FL/fl_draw.H
+++ FL/fl_draw.H
@@ -688,7 +688,7 @@ FL_EXPORT const char *fl_local_to_mac_roman(const char *t, int n=-1);
 /** \addtogroup  fl_drawings
     @{ */
 
-FL_EXPORT float fl_remove_scale();
+FL_EXPORT float fl_override_scale();
 
 FL_EXPORT void fl_restore_scale(float s);
 
diff --git src/Fl_Graphics_Driver.cxx src/Fl_Graphics_Driver.cxx
index 00eaf5a..43e7541 100644
--- src/Fl_Graphics_Driver.cxx
+++ src/Fl_Graphics_Driver.cxx
@@ -626,7 +626,7 @@ void Fl_Graphics_Driver::overlay_rect(int x, int y, int w , int h) {
   loop(x, y, x+w-1, y, x+w-1, y+h-1, x, y+h-1);
 }
 
-float Fl_Graphics_Driver::remove_scale() { return 1.f;}
+float Fl_Graphics_Driver::override_scale() { return scale();}
 
 void Fl_Graphics_Driver::restore_scale(float) { }
 
@@ -979,7 +979,7 @@ void Fl_Scalable_Graphics_Driver::draw_image_mono_unscaled(Fl_Draw_Image_Cb cb,
 
 void Fl_Scalable_Graphics_Driver::transformed_vertex0(float x, float y) {}
 
-float Fl_Scalable_Graphics_Driver::remove_scale() {
+float Fl_Scalable_Graphics_Driver::override_scale() {
   float s = scale();
   if (s != 1.f) {
     push_no_clip();
diff --git src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H
index 7e4aab9..d9051ec 100644
--- src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H
+++ src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H
@@ -188,7 +188,7 @@ protected:
   void descriptor_init(const char* name, Fl_Fontsize Size, Fl_Quartz_Font_Descriptor *d);
 #endif
   virtual void overlay_rect(int x, int y, int w , int h);
-  virtual float remove_scale();
+  virtual float override_scale();
   virtual void restore_scale(float);
 };
 
diff --git src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
index acabf6e..ab95ce5 100644
--- src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
+++ src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
@@ -160,7 +160,7 @@ void Fl_Quartz_Graphics_Driver::cache_size(Fl_Image *img, int &width, int &heigh
   height *= 2 * scale();
 }
 
-float Fl_Quartz_Graphics_Driver::remove_scale() {
+float Fl_Quartz_Graphics_Driver::override_scale() {
   float s = scale();
   if (s != 1.f && Fl_Display_Device::display_device()->is_current()) {
     Fl::screen_driver()->scale(0, 1.f);
diff --git src/fl_draw.cxx src/fl_draw.cxx
index 538e63f..1690636 100644
--- src/fl_draw.cxx
+++ src/fl_draw.cxx
@@ -464,14 +464,14 @@ int fl_height(int font, int size) {
  This function can be used to transiently perform drawing operations
  that are not rescaled by the current value of the GUI scaling factor.
  The resulting drawing context has no clipping region.
- \return The GUI scaling factor value that was applied when the function started.
+ \return The GUI scaling factor value that was in place when the function started.
  */
-float fl_remove_scale() {
-  return fl_graphics_driver->remove_scale();
+float fl_override_scale() {
+  return fl_graphics_driver->override_scale();
 }
 
 /** Restores the GUI scaling factor and the clipping region in subsequent drawing operations.
- \param s Value returned by a previous call to fl_remove_scale(). */
+ \param s Value returned by a previous call to fl_override_scale(). */
 void fl_restore_scale(float s) {
   fl_graphics_driver->restore_scale(s);
 }
Direct Link to Message ]
 
     
Previous Message ]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'.