mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 03:17:02 +02:00
Fixed Else case where _renderImage is true but the texture has 0 size, else case did not previously exist.
This commit is contained in:
parent
85f6fdb8cf
commit
99c563602f
1 changed files with 5 additions and 8 deletions
|
@ -75,8 +75,6 @@ void ImageOverlay::render(RenderArgs* args) {
|
||||||
glm::vec2 topLeft(left, top);
|
glm::vec2 topLeft(left, top);
|
||||||
glm::vec2 bottomRight(right, bottom);
|
glm::vec2 bottomRight(right, bottom);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if for some reason our image is not over 0 width or height, don't attempt to render the image
|
// if for some reason our image is not over 0 width or height, don't attempt to render the image
|
||||||
if (_renderImage) {
|
if (_renderImage) {
|
||||||
float imageWidth = _texture->getWidth();
|
float imageWidth = _texture->getWidth();
|
||||||
|
@ -108,16 +106,15 @@ void ImageOverlay::render(RenderArgs* args) {
|
||||||
glm::vec2 texCoordBottomRight(x + w, y + h);
|
glm::vec2 texCoordBottomRight(x + w, y + h);
|
||||||
|
|
||||||
DependencyManager::get<GeometryCache>()->renderQuad(topLeft, bottomRight, texCoordTopLeft, texCoordBottomRight, quadColor);
|
DependencyManager::get<GeometryCache>()->renderQuad(topLeft, bottomRight, texCoordTopLeft, texCoordBottomRight, quadColor);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
DependencyManager::get<GeometryCache>()->renderQuad(topLeft, bottomRight, quadColor);
|
DependencyManager::get<GeometryCache>()->renderQuad(topLeft, bottomRight, quadColor);
|
||||||
}
|
}
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
if (_renderImage) {
|
} else {
|
||||||
glDisable(GL_TEXTURE_2D);
|
DependencyManager::get<GeometryCache>()->renderQuad(topLeft, bottomRight, quadColor);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageOverlay::setProperties(const QScriptValue& properties) {
|
void ImageOverlay::setProperties(const QScriptValue& properties) {
|
||||||
Overlay2D::setProperties(properties);
|
Overlay2D::setProperties(properties);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue