Initialize name_pixbuf and make sure set_name_text doesn't do anything if there is no name_pixbuf.

git-svn-id: svn://localhost/ardour2/branches/3.0@5078 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Sampo Savolainen 2009-05-14 20:16:01 +00:00
parent db7a8cbcc2
commit 7d2e28bba0

View file

@ -171,6 +171,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
show_vestigial = true;
visibility = vis;
_sensitive = true;
name_pixbuf = 0;
if (duration == 0) {
warning << "Time Axis Item Duration == 0" << endl ;
@ -560,6 +561,8 @@ TimeAxisViewItem::set_name_text(const ustring& new_name)
uint32_t pb_width, it_width;
double font_size;
if (!name_pixbuf) return;
font_size = NAME_FONT->get_size() / Pango::SCALE;
it_width = trackview.editor().frame_to_pixel(item_duration);
pb_width = new_name.length() * font_size;