13
0
git-svn-id: svn://localhost/ardour2/branches/3.0@5238 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2009-06-22 00:01:56 +00:00
parent 49928d3fa3
commit 3be7176862

View File

@ -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 {