Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix clipping issues with the OpenGL painter.

This was exposed by
b25ec2e

(This is a different version of the same fix in trunk -
ce0ad7f)
  • Loading branch information...
commit 25ffbc31b429044f382932238d6d81e5259805ae 1 parent b259732
Mark Kendall authored
Showing with 11 additions and 8 deletions.
  1. +11 −8 mythtv/libs/libmythui/mythrender_opengl.cpp
View
19 mythtv/libs/libmythui/mythrender_opengl.cpp
@@ -893,24 +893,27 @@ void MythRenderOpenGL::DrawBitmap(uint tex, uint target, const QRect *src,
prog = 0;
double srcx1, srcx2, srcy1, srcy2;
+ QSize size = m_textures[tex].m_size;
+ int width = std::min(src->width(), size.width());
+ int height = std::min(src->height(), size.height());
if (tex && !IsRectTexture(m_textures[tex].m_type))
{
- srcx1 = src->x() / (double)m_textures[tex].m_size.width();
- srcx2 = srcx1 + src->width() / (double)m_textures[tex].m_size.width();
- srcy1 = src->y() / (double)m_textures[tex].m_size.height();
- srcy2 = srcy1 + src->height() / (double)m_textures[tex].m_size.height();
+ srcx1 = src->x() / (double)size.width();
+ srcx2 = srcx1 + width / (double)size.width();
+ srcy1 = src->y() / (double)size.height();
+ srcy2 = srcy1 + height / (double)size.height();
}
else
{
srcx1 = src->x();
- srcx2 = srcx1 + src->width();
+ srcx2 = srcx1 + width;
srcy1 = src->y();
- srcy2 = srcy1 + src->height();
+ srcy2 = srcy1 + height;
}
- int width = std::min(src->width(), dst->width());
- int height = std::min(src->height(), dst->height());
+ width = std::min(width, dst->width());
+ height = std::min(height, dst->height());
makeCurrent();
Please sign in to comment.
Something went wrong with that request. Please try again.