From 4b5a9cf1da40fc72be07565e1dc244ff2407b7b6 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Tue, 14 Feb 2006 09:01:07 +0000 Subject: Fix the bug 58 about a miscalculated bbox (not centered. --- generic/Track.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'generic') diff --git a/generic/Track.c b/generic/Track.c index 0b25256..f10e461 100644 --- a/generic/Track.c +++ b/generic/Track.c @@ -719,15 +719,13 @@ ComputeCoordinates(ZnItem item, /*printf("track pos %g %g --> %g %g\n", track->pos.x, track->pos.y, track->dev.x, track->dev.y);*/ if (track->symbol != ZnUnspecifiedImage) { ZnSizeOfImage(track->symbol, &w_int, &h_int); - w = w_int; - h = h_int; /*printf("taille symbole %d %d\n", w, h);*/ - w2 = (w+1.0)/2.0; - h2 = (h+1.0)/2.0; + w2 = (w_int+1.0)/2.0; + h2 = (h_int+1.0)/2.0; bbox.orig.x = track->dev.x - w2; bbox.orig.y = track->dev.y - h2; - bbox.corner.x = bbox.orig.x + w; - bbox.corner.y = bbox.orig.y + h; + bbox.corner.x = track->dev.x + w2; + bbox.corner.y = track->dev.y + h2; ZnAddBBoxToBBox(&item->item_bounding_box, &bbox); } @@ -747,8 +745,7 @@ ComputeCoordinates(ZnItem item, wi->track_visible_history_size : 0); ZnResetBBox(&bbox); - w = track->history_width; - w2 = (w+1.0)/2.0; + w2 = (track->history_width+1.0)/2.0; num_acc_pos = ZnListSize(track->history); hist = ZnListArray(track->history); for (i = 0; i < num_acc_pos; i++) { @@ -756,8 +753,8 @@ ComputeCoordinates(ZnItem item, if ((i < visible_history_size) && (hist[i].visible)) { bbox.orig.x = hist[i].dev.x - w2; bbox.orig.y = hist[i].dev.y - w2; - bbox.corner.x = bbox.orig.x + w; - bbox.corner.y = bbox.orig.y + w; + bbox.corner.x = hist[i].dev.x + w2; + bbox.corner.y = hist[i].dev.y + w2; ZnAddBBoxToBBox(&item->item_bounding_box, &bbox); } } -- cgit v1.1