summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix_row_labels.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-12-07 00:41:50 +0000
committerCarl Hetherington <carl@carlh.net>2009-12-07 00:41:50 +0000
commit1a447016437727452fdf00e7c762f339c796f736 (patch)
treee22576a33816b113a9a10a7cb5f46558b7c3e903 /gtk2_ardour/port_matrix_row_labels.cc
parentb9876aa1d08f83b9a9ef829e6a4dad94cf344e30 (diff)
Fix a couple of crashes with empty matrices. Some small optimisations.
Correctly handle descenders on text when plotting labels. Minor layout improvements. Add some drawings of what's going on in the port matrix so that I don't keep losing them. git-svn-id: svn://localhost/ardour2/branches/3.0@6319 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix_row_labels.cc')
-rw-r--r--gtk2_ardour/port_matrix_row_labels.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/gtk2_ardour/port_matrix_row_labels.cc b/gtk2_ardour/port_matrix_row_labels.cc
index 6528f31d76..9878dc23dd 100644
--- a/gtk2_ardour/port_matrix_row_labels.cc
+++ b/gtk2_ardour/port_matrix_row_labels.cc
@@ -44,7 +44,6 @@ PortMatrixRowLabels::compute_dimensions ()
_longest_port_name = 0;
_longest_bundle_name = 0;
- _height = 0;
/* Compute maximum dimensions using all port groups, so that we allow for the largest and hence
we can change between visible groups without the size of the labels jumping around.
@@ -71,8 +70,12 @@ PortMatrixRowLabels::compute_dimensions ()
}
}
-
- _height += group_size (_matrix->visible_rows()) * grid_spacing ();
+
+ if (_matrix->visible_rows()) {
+ _height = group_size (_matrix->visible_rows()) * grid_spacing ();
+ } else {
+ _height = 0;
+ }
cairo_destroy (cr);
gdk_pixmap_unref (pm);