mirror of
https://github.com/fltk/fltk.git
synced 2025-12-17 02:54:24 +08:00
Simpler code and doc of Fl::screen_scale(int n, float factor)
This commit is contained in:
11
src/Fl.cxx
11
src/Fl.cxx
@@ -2133,17 +2133,12 @@ float Fl::screen_scale(int n) {
|
|||||||
return Fl::screen_driver()->scale(n);
|
return Fl::screen_driver()->scale(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set the value of the GUI scaling factor for screen number \p n.
|
/** Sets the value of the GUI scaling factor for screen number \p n.
|
||||||
When this function is called before the first window is show()'n it sets the
|
Also sets the scale factor value of all windows mapped to screen number \p n, if any.
|
||||||
application's initial scaling factor value. Otherwise, it sets the scale factor value of all windows mapped to screen number \p n */
|
*/
|
||||||
void Fl::screen_scale(int n, float factor) {
|
void Fl::screen_scale(int n, float factor) {
|
||||||
if (!Fl::screen_scaling_supported() || n < 0 || n >= Fl::screen_count()) return;
|
if (!Fl::screen_scaling_supported() || n < 0 || n >= Fl::screen_count()) return;
|
||||||
if (Fl::first_window()) {
|
|
||||||
Fl::screen_driver()->rescale_all_windows_from_screen(n, factor);
|
Fl::screen_driver()->rescale_all_windows_from_screen(n, factor);
|
||||||
} else {
|
|
||||||
Fl::screen_driver()->scale(n, factor);
|
|
||||||
Fl_Graphics_Driver::default_driver().scale(factor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user