From 74a5130dd4da897be68aa3bb4e8ebb76f280628b Mon Sep 17 00:00:00 2001 From: reinelt Date: Sun, 12 Jan 2003 06:51:27 +0000 Subject: [lcd4linux @ 2003-01-12 06:51:27 by reinelt] fixed bug in bar compaction git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@176 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- bar.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'bar.c') diff --git a/bar.c b/bar.c index 837eee1..ff65673 100644 --- a/bar.c +++ b/bar.c @@ -1,4 +1,4 @@ -/* $Id: bar.c,v 1.3 2002/08/19 07:52:19 reinelt Exp $ +/* $Id: bar.c,v 1.4 2003/01/12 06:51:27 reinelt Exp $ * * generic bar handling * @@ -20,6 +20,9 @@ * * * $Log: bar.c,v $ + * Revision 1.4 2003/01/12 06:51:27 reinelt + * fixed bug in bar compaction + * * Revision 1.3 2002/08/19 07:52:19 reinelt * corrected type declaration of (*defchar)() * @@ -250,7 +253,7 @@ static int segment_deviation (int i, int j) j1=Segment[j].len1; if (j1>RES) i1=RES; j2=Segment[j].len2; if (j2>RES) i2=RES; - return (i1-i2)*(i1-i2)+(j1-j2)*(j1-j2); + return (i1-j1)*(i1-j1)+(i2-j2)*(i2-j2); } @@ -265,11 +268,9 @@ static void pack_segments (void) return; } - for (i=0; i