From 9a7f4bdfcebe04ff85e75d9fc999b3731c9941e4 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:04:24 +0100 Subject: Document that function fl_scroll() doesn't work OK with non integral scaling factors and explain how to get correct results. --- src/fl_scroll_area.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/fl_scroll_area.cxx') diff --git a/src/fl_scroll_area.cxx b/src/fl_scroll_area.cxx index 7574fa669..1472c2db8 100644 --- a/src/fl_scroll_area.cxx +++ b/src/fl_scroll_area.cxx @@ -32,6 +32,12 @@ The contents of the rectangular area is first shifted by \p dx and \p dy pixels. The \p draw_area callback is then called for every newly exposed rectangular area. + \warning With FLTK 1.4 and above, it's recommended to put graphical elements in an Fl_Scroll + widget rather than use function fl_scroll() to update those elements. That's because fl_scroll() + may not produce a pixel-accurate result when the GUI scaling factor value is not a multiple of 100%. + Alternatively, use fl_scroll() when the scaling factor value is a multiple of 100% and perform a + full redraw of the graphical elements otherwise. Statement float s = Fl::screen_scale(win->screen_num()); + gives the current scaling factor value given Fl_Window *win. */ void fl_scroll(int X, int Y, int W, int H, int dx, int dy, void (*draw_area)(void*, int,int,int,int), void* data) -- cgit v1.2.3