From 25a78534aae5eae68b241e9419bffdd21f294fe8 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 19 Dec 2014 15:52:31 -0800 Subject: [PATCH] Fix quad vertices for ImageOverlay and TextOverlay --- interface/src/ui/overlays/ImageOverlay.cpp | 13 +++++++++---- interface/src/ui/overlays/TextOverlay.cpp | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/interface/src/ui/overlays/ImageOverlay.cpp b/interface/src/ui/overlays/ImageOverlay.cpp index f903dfe19c..b14f49737f 100644 --- a/interface/src/ui/overlays/ImageOverlay.cpp +++ b/interface/src/ui/overlays/ImageOverlay.cpp @@ -100,26 +100,31 @@ void ImageOverlay::render(RenderArgs* args) { float w = fromImage.width() / imageWidth; // ?? is this what we want? not sure float h = fromImage.height() / imageHeight; + int left = _bounds.left(); + int right = _bounds.right() + 1; + int top = _bounds.top(); + int bottom = _bounds.bottom() + 1; + glBegin(GL_QUADS); if (_renderImage) { glTexCoord2f(x, 1.0f - y); } - glVertex2f(_bounds.left(), _bounds.top()); + glVertex2f(left, top); if (_renderImage) { glTexCoord2f(x + w, 1.0f - y); } - glVertex2f(_bounds.right(), _bounds.top()); + glVertex2f(right, top); if (_renderImage) { glTexCoord2f(x + w, 1.0f - (y + h)); } - glVertex2f(_bounds.right(), _bounds.bottom()); + glVertex2f(right, bottom); if (_renderImage) { glTexCoord2f(x, 1.0f - (y + h)); } - glVertex2f(_bounds.left(), _bounds.bottom()); + glVertex2f(left, bottom); glEnd(); if (_renderImage) { diff --git a/interface/src/ui/overlays/TextOverlay.cpp b/interface/src/ui/overlays/TextOverlay.cpp index 97d910eb64..03a5c3d846 100644 --- a/interface/src/ui/overlays/TextOverlay.cpp +++ b/interface/src/ui/overlays/TextOverlay.cpp @@ -70,11 +70,16 @@ void TextOverlay::render(RenderArgs* args) { glColor4f(backgroundColor.red / MAX_COLOR, backgroundColor.green / MAX_COLOR, backgroundColor.blue / MAX_COLOR, getBackgroundAlpha()); + int left = _bounds.left(); + int right = _bounds.right() + 1; + int top = _bounds.top(); + int bottom = _bounds.bottom() + 1; + glBegin(GL_QUADS); - glVertex2f(_bounds.left(), _bounds.top()); - glVertex2f(_bounds.right(), _bounds.top()); - glVertex2f(_bounds.right(), _bounds.bottom()); - glVertex2f(_bounds.left(), _bounds.bottom()); + glVertex2f(left, top); + glVertex2f(right, top); + glVertex2f(right, bottom); + glVertex2f(left, bottom); glEnd(); // Same font properties as textSize()