From f990adcfab61c16a3992be4d00e21da5a2bfe251 Mon Sep 17 00:00:00 2001 From: Julian Lamb Date: Tue, 8 Mar 2011 21:07:39 -0500 Subject: [PATCH] prevent empty layers from messing up the bounding box calcs (for zoom fit, etc) fixes bug 3201028 --- src/gerbv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gerbv.c b/src/gerbv.c index 905037c..8df979a 100644 --- a/src/gerbv.c +++ b/src/gerbv.c @@ -547,10 +547,15 @@ gerbv_render_get_boundingbox(gerbv_project_t *gerbvProject, gerbv_render_size_t * Find the biggest image and use as a size reference */ /* cairo info already has offset calculated into min/max */ + minX = info->min_x; minY = info->min_y; maxX = info->max_x; maxY = info->max_y; + + if (!isnormal(minX)||!isnormal(minY)||!isnormal(maxX)||!isnormal(maxY)){ + continue; + } /* transform the bounding box based on the user transform */ cairo_matrix_t fullMatrix; -- 2.11.4.GIT