From b13db6ad342f0c8eaa296c7863938967f46bc408 Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Sun, 19 Dec 2004 16:53:23 +0000 Subject: [PATCH] Fixed crash on level editor by making a pos test. SVN-Revision: 2257 --- src/object/tilemap.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/object/tilemap.cpp b/src/object/tilemap.cpp index fd6c74dd4..4046813b4 100644 --- a/src/object/tilemap.cpp +++ b/src/object/tilemap.cpp @@ -144,7 +144,9 @@ TileMap::draw(DrawingContext& context) /** if we don't round here, we'll have a 1 pixel gap on screen sometimes. * I have no idea why */ float start_x = roundf(context.get_translation().x); + if(start_x < 0) start_x = 0; float start_y = roundf(context.get_translation().y); + if(start_y < 0) start_y = 0; float end_x = std::min(start_x + screen->w, float(width * 32)); float end_y = std::min(start_y + screen->h, float(height * 32)); start_x -= int(start_x) % 32; -- 2.11.0