summaryrefslogtreecommitdiff
path: root/src/Fl_Gl_Device_Plugin.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-01-06 10:22:41 +0000
committerManolo Gouy <Manolo>2015-01-06 10:22:41 +0000
commit4ba65cb993255dd1aee5a26f613ab6b8fbefda1e (patch)
tree9f01781306f76eee673840be2c247232dd0d8f48 /src/Fl_Gl_Device_Plugin.cxx
parente14b04e6cb54cc06c3d610f50d494921780eb940 (diff)
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
Diffstat (limited to 'src/Fl_Gl_Device_Plugin.cxx')
-rw-r--r--src/Fl_Gl_Device_Plugin.cxx5
1 files 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;