added a TODO comment, I forgot to mention that anything but B_TRUNCATE_END is untested or broken
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12978 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
590fdd3f2d
commit
0b5938e995
@ -786,7 +786,7 @@ copy_from_end(const char* src, char* dst, uint32 numChars, uint32 length,
|
|||||||
// ups, we definitely don't fit. go back until the ellipsis fits
|
// ups, we definitely don't fit. go back until the ellipsis fits
|
||||||
currentWidth += ellipsisWidth;
|
currentWidth += ellipsisWidth;
|
||||||
// go forward again until ellipsis fits (already beyond the target)
|
// go forward again until ellipsis fits (already beyond the target)
|
||||||
for (int32 c2 = c; c2 < (int32)numChars; c2++) {
|
for (uint32 c2 = c; c2 < numChars; c2++) {
|
||||||
//printf(" backward: %c (%ld) (%.1f - %.1f = %.1f)\n", *dst, c2, currentWidth, escapementArray[c2] * size, currentWidth - escapementArray[c2] * size);
|
//printf(" backward: %c (%ld) (%.1f - %.1f = %.1f)\n", *dst, c2, currentWidth, escapementArray[c2] * size, currentWidth - escapementArray[c2] * size);
|
||||||
currentWidth -= escapementArray[c2] * size;
|
currentWidth -= escapementArray[c2] * size;
|
||||||
do {
|
do {
|
||||||
@ -882,6 +882,7 @@ truncate_string(const char* string,
|
|||||||
// FALL THROUGH (at least do something)
|
// FALL THROUGH (at least do something)
|
||||||
case B_TRUNCATE_MIDDLE:
|
case B_TRUNCATE_MIDDLE:
|
||||||
|
|
||||||
|
// TODO: VERY BROKEN! (will always insert "…" even if width is large enough)
|
||||||
float halfWidth = width / 2.0;
|
float halfWidth = width / 2.0;
|
||||||
|
|
||||||
dst = copy_from_start(src, dst, numChars,
|
dst = copy_from_start(src, dst, numChars,
|
||||||
|
Loading…
Reference in New Issue
Block a user