mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
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:
parent
edfc81352e
commit
4b35fc4c68
15 changed files with 116 additions and 28 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue