From 177fe9cc36566077f1182941d817bc85ce7fee81 Mon Sep 17 00:00:00 2001 From: werner Date: Sun, 31 Oct 2010 12:11:18 +0000 Subject: [PATCH] The box coordinates were not properly initialized in gui_draw_pad_text - gui_inst.c (gui_draw_pad_text): box_min and box_max were initialized to an undefined value, upsetting valgrind and yielding an incorrect location if pad and hole had the same size git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5994 99fdad57-331a-0410-800a-d7fa5415bdb3 --- gui_inst.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gui_inst.c b/gui_inst.c index f5080a6..591af55 100644 --- a/gui_inst.c +++ b/gui_inst.c @@ -297,9 +297,11 @@ static void gui_draw_pad_text(struct inst *self) hole_max = translate(self->u.pad.hole->u.hole.other); sort_coord(&hole_min, &hole_max); - box_min.x = box_min.y = box_max.x = box_max.y; - maximize_box(&box_min, &box_max, - pad_min.x, pad_min.y, pad_max.x, hole_min.y); /* top */ + box_min.x = pad_min.x; /* top */ + box_min.y = pad_min.y; + box_max.x = pad_max.x; + box_max.y = hole_min.y; + maximize_box(&box_min, &box_max, pad_min.x, hole_max.y, pad_max.x, pad_max.y); /* bottom */ maximize_box(&box_min, &box_max,