summaryrefslogtreecommitdiff
path: root/gtk2_ardour/utils.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-06-22 00:01:56 +0000
committerCarl Hetherington <carl@carlh.net>2009-06-22 00:01:56 +0000
commit3be717686279a0419437721d88a9f77c14e71f0b (patch)
treef369514391b26401652293ae462e387de757f498 /gtk2_ardour/utils.cc
parent49928d3fa3d96942deffe70c5845175986b1ce44 (diff)
Bug fix.
git-svn-id: svn://localhost/ardour2/branches/3.0@5238 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r--gtk2_ardour/utils.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index dc410136d7..85bb46c6c8 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -122,17 +122,14 @@ fit_to_pixels (cairo_t* cr, std::string name, double avail)
uint32_t width = 0;
while (1) {
- if (name.length() <= 4) {
- break;
- }
-
cairo_text_extents_t ext;
cairo_text_extents (cr, name.c_str(), &ext);
- if (ext.width < avail) {
+
+ if (ext.width < avail || name.length() <= 4) {
width = ext.width;
break;
}
-
+
if (abbreviated) {
name = name.substr (0, name.length() - 4) + "...";
} else {