From 4ba65cb993255dd1aee5a26f613ab6b8fbefda1e Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 6 Jan 2015 10:22:41 +0000 Subject: Don not assume that Fl_X::resolution_scaling_factor() returns either 1 or 2. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10509 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Gl_Device_Plugin.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Fl_Gl_Device_Plugin.cxx b/src/Fl_Gl_Device_Plugin.cxx index 8dbdb297f..e9b43d1cf 100644 --- a/src/Fl_Gl_Device_Plugin.cxx +++ b/src/Fl_Gl_Device_Plugin.cxx @@ -53,8 +53,9 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w { #if defined(__APPLE__) const int bytesperpixel = 4; - if (Fl_X::resolution_scaling_factor(glw) > 1) { - w = 2*w; h = 2*h; x = 2*x; y = 2*y; + int factor = Fl_X::resolution_scaling_factor(glw); + if (factor > 1) { + w *= factor; h *= factor; x *= factor; y *= factor; } #else const int bytesperpixel = 3; -- cgit v1.2.3