aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
authorlecoanet2006-02-14 09:01:07 +0000
committerlecoanet2006-02-14 09:01:07 +0000
commit4b5a9cf1da40fc72be07565e1dc244ff2407b7b6 (patch)
tree78b1b7eaa9ebc898f1d73933301e353ee865c2b6 /generic
parent336397fe894daf4a3db41109668b4704fcf990c2 (diff)
downloadtkzinc-4b5a9cf1da40fc72be07565e1dc244ff2407b7b6.zip
tkzinc-4b5a9cf1da40fc72be07565e1dc244ff2407b7b6.tar.gz
tkzinc-4b5a9cf1da40fc72be07565e1dc244ff2407b7b6.tar.bz2
tkzinc-4b5a9cf1da40fc72be07565e1dc244ff2407b7b6.tar.xz
Fix the bug 58 about a miscalculated bbox (not centered.
Diffstat (limited to 'generic')
-rw-r--r--generic/Track.c17
1 files changed, 7 insertions, 10 deletions
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);
}
}