From 678cd10029aa308b983d8151664ed4709dd3f618 Mon Sep 17 00:00:00 2001 From: Alec Lofquist Date: Tue, 10 Jun 2014 17:36:03 +0000 Subject: [PATCH] Fixed white space on the left/top of background images with an origin of "0.5 0.5". Hopefully. Added additional error output when SDL renderer fails to create window. --- src/Renderer_init_sdlgl.cpp | 2 +- src/components/ImageComponent.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Renderer_init_sdlgl.cpp b/src/Renderer_init_sdlgl.cpp index ec12f02a8..65abd0dad 100644 --- a/src/Renderer_init_sdlgl.cpp +++ b/src/Renderer_init_sdlgl.cpp @@ -66,7 +66,7 @@ namespace Renderer if(sdlWindow == NULL) { - LOG(LogError) << "Error creating SDL window!"; + LOG(LogError) << "Error creating SDL window!\n\t" << SDL_GetError(); return false; } diff --git a/src/components/ImageComponent.cpp b/src/components/ImageComponent.cpp index 8420d2dc4..1ac2c478a 100644 --- a/src/components/ImageComponent.cpp +++ b/src/components/ImageComponent.cpp @@ -189,8 +189,8 @@ void ImageComponent::updateVertices() const float width = round(bottomRight.x() - topLeft.x()); const float height = round(bottomRight.y() - topLeft.y()); - topLeft[0] = round(topLeft[0]); - topLeft[1] = round(topLeft[1]); + topLeft[0] = floor(topLeft[0]); + topLeft[1] = floor(topLeft[1]); bottomRight[0] = topLeft[0] + width; bottomRight[1] = topLeft[1] + height;