diff src/textabbrev.cpp @ 464:6fc4fafc5e6b

Further minor abbrev fix
author Chris Cannam
date Mon, 04 Jul 2011 13:48:04 +0100
parents 3d7070aa959e
children 533519ebc0cb
line wrap: on
line diff
--- a/src/textabbrev.cpp	Mon Jul 04 13:31:39 2011 +0100
+++ b/src/textabbrev.cpp	Mon Jul 04 13:48:04 2011 +0100
@@ -117,7 +117,7 @@
 
         while (tw > maxWidth && truncateTo > 1) {
 
-            if (tw > maxWidth + acw * 10) {
+            if (tw > maxWidth + acw * (ellipsis.length() + 5)) {
                 float ratio = float(maxWidth) / float(tw);
                 truncateTo = int(truncateTo * ratio * 1.2) + 10;
                 if (truncateTo >= tl) truncateTo = tl - 1;
@@ -139,7 +139,7 @@
 
 //        std::cerr << "done, final tw = " << tw << std::endl;
         
-        maxWidth = tw;
+        maxWidth = std::max(maxWidth, tw);
         return text;
 
     } else {