From fbce782f1d566c318737bf7e5ab55d0a66fb2a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 16 Apr 2009 10:37:08 +0200 Subject: Fix off-by-one bugs in the framebuffer blits. The bottom-right coordinates are exclusive, not inclusive. --- src/opengl/qglframebufferobject.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 45d4788..61d0f85 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -1132,14 +1132,14 @@ void QGLFramebufferObject::blitFramebuffer(QGLFramebufferObject *target, const Q const int th = target ? target->height() : height; const int sx0 = sourceRect.left(); - const int sx1 = sourceRect.right(); - const int sy0 = sh - sourceRect.bottom() - 1; - const int sy1 = sh - sourceRect.top() - 1; + const int sx1 = sourceRect.left() + sourceRect.width(); + const int sy0 = sh - (sourceRect.top() + sourceRect.height()); + const int sy1 = sh - sourceRect.top(); const int tx0 = targetRect.left(); - const int tx1 = targetRect.right(); - const int ty0 = th - targetRect.bottom() - 1; - const int ty1 = th - targetRect.top() - 1; + const int tx1 = targetRect.left() + targetRect.width(); + const int ty0 = th - (targetRect.top() + targetRect.height()); + const int ty1 = th - targetRect.top(); glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, source ? source->handle() : 0); glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, target ? target->handle() : 0); -- cgit v0.12