summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2013-09-19 15:42:49 +0200
committerSven Eden <yamakuzure@gmx.net>2013-09-19 15:42:49 +0200
commitbe5a88cd3986f81fe3be6fd3381ab7e0449cff7b (patch)
tree15b17e9a71fbef2bfbbd2d79fc5f96940a532ace /ufed-curses-types.c
parentFixed stray 0-bytes that the wrapped description display accidently inserted. (diff)
downloadufed-be5a88cd3986f81fe3be6fd3381ab7e0449cff7b.tar.gz
ufed-be5a88cd3986f81fe3be6fd3381ab7e0449cff7b.tar.bz2
ufed-be5a88cd3986f81fe3be6fd3381ab7e0449cff7b.zip
drawing a flag witrh wrapped descriptions does no longer add an offset for the second part. The calculation does this now, which simplifies things alot.
Diffstat (limited to 'ufed-curses-types.c')
-rw-r--r--ufed-curses-types.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ufed-curses-types.c b/ufed-curses-types.c
index e6b1139..4a5445f 100644
--- a/ufed-curses-types.c
+++ b/ufed-curses-types.c
@@ -533,6 +533,8 @@ static void calculateDescWrap(sDesc* desc)
size_t pLen = pPkg ? strlen(pPkg) : 0;
size_t left = dLen + pLen;
size_t wLen = eOrder_left == desc->wrapOrder ? pLen : dLen;
+ size_t oLen = 0; // Set to the first part to be added to pos on the second
+ // part, so drawflag knows from where to start taking in the unified desc.
/* A valid curr is needed first */
if (NULL == curr) {
@@ -581,7 +583,7 @@ static void calculateDescWrap(sDesc* desc)
}
// Step 3: Note values and increase start
- curr->pos = start;
+ curr->pos = start + oLen;
curr->len = end - start + (' ' == pch[end] ? 0 : 1);
start += curr->len;
left -= curr->len;
@@ -600,12 +602,12 @@ static void calculateDescWrap(sDesc* desc)
// Switch from pkg to desc
pch = pDesc;
wLen = dLen;
- left = dLen;
+ oLen = pLen + 2;
} else {
// Switch from desc to pkg
pch = pPkg;
wLen = pLen;
- left = pLen;
+ oLen = dLen + 2;
}
start = 0;
} // End of having to swap pkg/desc