audun's tempo redraw fix; sort-of cache time axis view item name widths and avoid pango-width-computation when unnecessary

git-svn-id: svn://localhost/ardour2/trunk@1657 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2007-04-03 02:05:34 +00:00
parent edfc81352e
commit 4b35fc4c68
15 changed files with 116 additions and 28 deletions

View file

@ -44,6 +44,20 @@ using namespace sigc;
using namespace Glib;
using namespace PBD;
int
pixel_width (const ustring& str, Pango::FontDescription& font)
{
Label foo;
Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout ("");
layout->set_font_description (font);
layout->set_text (str);
int width, height;
Gtkmm2ext::get_ink_pixel_size (layout, width, height);
return width;
}
ustring
fit_to_pixels (const ustring& str, int pixel_width, Pango::FontDescription& font, int& actual_width, bool with_ellipses)
{