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?
This commit is contained in:
ManoloFLTK 2021-02-27 08:18:01 +01:00
parent 5c1b69cd4f
commit 88a3f7b7be
6 changed files with 11 additions and 11 deletions

View File

@ -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

View File

@ -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);

View File

@ -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();

View File

@ -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);
};

View File

@ -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);

View File

@ -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);
}