diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-07 03:41:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-07 03:41:03 +0400 |
commit | 0ecbc047e8a540175b00ed967050abb5f7363dbc (patch) | |
tree | fdf8a8011f919fb606b07d357a3be8b9606bf592 /source/blender/editors/space_view3d/view3d_draw.c | |
parent | 774cc0ab1663a5d31eeda797ac71c5143086ca98 (diff) |
code cleanup
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 39b92645166..8a334423ab0 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1389,14 +1389,17 @@ unsigned int view3d_sample_backbuf(ViewContext *vc, int x, int y) { unsigned int col; - if (x >= vc->ar->winx || y >= vc->ar->winy) return 0; + if (x >= vc->ar->winx || y >= vc->ar->winy) { + return 0; + } + x += vc->ar->winrct.xmin; y += vc->ar->winrct.ymin; view3d_validate_backbuf(vc); - glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col); - glReadBuffer(GL_BACK); + glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col); + glReadBuffer(GL_BACK); if (ENDIAN_ORDER == B_ENDIAN) { BLI_endian_switch_uint32(&col); |