From e08bd77d510bbc7816d3f32f30ef3279ad721e52 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sat, 25 Sep 2010 06:35:29 -0300 Subject: [PATCH] Yet another overlap display correction. Avoid truncation on save-load cycle. - solidify/overlap.c (merge_matrix): don't shrink the offset vector - solidify/project.c (read_face_data): the value to assign to f->z_ref needs rounding or truncation will go wrong from time to time --- solidify/overlap.c | 4 ++-- solidify/project.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/solidify/overlap.c b/solidify/overlap.c index 4ecec71..96ff593 100644 --- a/solidify/overlap.c +++ b/solidify/overlap.c @@ -185,10 +185,10 @@ static void merge_matrix(struct matrix *m, const struct solid *s, m->a[0][0] *= f_x; m->a[0][1] *= f_x; - m->b[0] *= f_x; +// m->b[0] *= f_x; m->a[1][0] *= f_y; m->a[1][1] *= f_y; - m->b[1] *= f_y; +// m->b[1] *= f_y; /* * The transformation matrix f->m describes a transformation of diff --git a/solidify/project.c b/solidify/project.c index 792d3fc..10e703d 100644 --- a/solidify/project.c +++ b/solidify/project.c @@ -67,7 +67,7 @@ static void read_face_data(FILE *file, struct face *f) if (fscanf(file, "%f", &v) != 1) return; - f->z_ref = v/f->z_step; + f->z_ref = round(v/f->z_step); if (fscanf(file, "%f", &v) != 1) return;