aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2003-08-20 05:26:43 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2003-08-20 05:26:43 +0000
commit626abb5929b0eed658fe2ef599a228b8b07f8a21 (patch)
tree8920710479b9c33ee36abbc7761216a67e2c676d
parent191b04cd6a955fd0e897d08b8a0d5f34fd6751aa (diff)
downloadlcd4linux-626abb5929b0eed658fe2ef599a228b8b07f8a21.tar.gz
[lcd4linux @ 2003-08-20 05:26:43 by reinelt]
small bug in bar compaction fixed git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@225 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r--bar.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/bar.c b/bar.c
index 3d6e3c4..82a0881 100644
--- a/bar.c
+++ b/bar.c
@@ -1,4 +1,4 @@
-/* $Id: bar.c,v 1.5 2003/08/19 04:28:41 reinelt Exp $
+/* $Id: bar.c,v 1.6 2003/08/20 05:26:43 reinelt Exp $
*
* generic bar handling
*
@@ -20,6 +20,9 @@
*
*
* $Log: bar.c,v $
+ * Revision 1.6 2003/08/20 05:26:43 reinelt
+ * small bug in bar compaction fixed
+ *
* Revision 1.5 2003/08/19 04:28:41 reinelt
* more Icon stuff, minor glitches fixed
*
@@ -249,18 +252,17 @@ static int segment_deviation (int i, int j)
i1=Segment[i].len1; if (i1>RES) i1=RES;
i2=Segment[i].len2; if (i2>RES) i2=RES;
- j1=Segment[j].len1; if (j1>RES) i1=RES;
- j2=Segment[j].len2; if (j2>RES) i2=RES;
+ j1=Segment[j].len1; if (j1>RES) j1=RES;
+ j2=Segment[j].len2; if (j2>RES) j2=RES;
if (i1==0 && j1!=0) return 65535;
if (i2==0 && j2!=0) return 65535;
- if (i1>=RES && j1<RES) return 65535;
- if (i2>=RES && j2<RES) return 65535;
+ if (i1==RES && j1<RES) return 65535;
+ if (i2==RES && j2<RES) return 65535;
+ if (i1==1 && j1!=1 && i2 > 0) return 65535;
+ if (i2==1 && j2!=1 && j1 > 0) return 65535;
if (i1==i2 && j1!=j2) return 65535;
- if (i1==1 && j1==0) return 65535;
- if (i2==1 && j2==0) return 65535;
-
return (i1-j1)*(i1-j1)+(i2-j2)*(i2-j2);
}
@@ -271,7 +273,7 @@ static void pack_segments (void)
int pack_i, pack_j;
int pass1=1;
int deviation[nSegment][nSegment];
-
+
if (nSegment<=fSegment+CHARS) {
return;
}