aboutsummaryrefslogtreecommitdiffstats
path: root/bar.c
diff options
context:
space:
mode:
authorreinelt <>2003-09-09 05:30:34 +0000
committerreinelt <>2003-09-09 05:30:34 +0000
commitb39a42b909dfb1c174044cf977d272f94445b18e (patch)
tree5170a8ead387da3151f849852239cdbbac5b72dc /bar.c
parent9e7b5817f97f51696d6f17a77c4a4ed82114a113 (diff)
downloadlcd4linux-b39a42b909dfb1c174044cf977d272f94445b18e.tar.gz
[lcd4linux @ 2003-09-09 05:30:33 by reinelt]
even more icons stuff
Diffstat (limited to 'bar.c')
-rw-r--r--bar.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/bar.c b/bar.c
index 9b3f826..f6e96bf 100644
--- a/bar.c
+++ b/bar.c
@@ -1,4 +1,4 @@
-/* $Id: bar.c,v 1.7 2003/09/01 04:09:34 reinelt Exp $
+/* $Id: bar.c,v 1.8 2003/09/09 05:30:34 reinelt Exp $
*
* generic bar handling
*
@@ -20,6 +20,9 @@
*
*
* $Log: bar.c,v $
+ * Revision 1.8 2003/09/09 05:30:34 reinelt
+ * even more icons stuff
+ *
* Revision 1.7 2003/09/01 04:09:34 reinelt
* icons nearly finished, but MatrixOrbital only
*
@@ -211,8 +214,10 @@ int bar_draw (int type, int row, int col, int max, int len1, int len2)
static void create_segments (void)
{
+ int RES;
int i, j, n;
-
+ int l1, l2;
+
/* find first unused segment */
for (i=fSegment; i<nSegment && Segment[i].used; i++);
@@ -226,10 +231,13 @@ static void create_segments (void)
/* create needed segments */
for (n=0; n<ROWS*COLS; n++) {
if (Bar[n].type==0) continue;
+ RES=Bar[n].type & BAR_H ? XRES:YRES;
for (i=0; i<nSegment; i++) {
- if (Segment[i].type & Bar[n].type &&
- Segment[i].len1== Bar[n].len1 &&
- Segment[i].len2== Bar[n].len2) break;
+ if (Segment[i].type & Bar[n].type) {
+ l1=Segment[i].len1; if (l1>RES) l1=RES;
+ l2=Segment[i].len2; if (l2>RES) l2=RES;
+ if (l1 == Bar[n].len1 && l2 == Bar[n].len2) break;
+ }
}
if (i==nSegment) {
nSegment++;