summaryrefslogtreecommitdiffstats
path: root/src/port.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-23 01:47:20 +0000
committerDavid Robillard <d@drobilla.net>2012-04-23 01:47:20 +0000
commit298bc503de64b3f42f71ecbd6009a32f9448bdb9 (patch)
tree89c88265236a5f85e991116b933b2160b87e1579 /src/port.c
parentf77f74472a6e46c0af101e7f1d52635c0147efd9 (diff)
downloadganv-298bc503de64b3f42f71ecbd6009a32f9448bdb9.tar.gz
ganv-298bc503de64b3f42f71ecbd6009a32f9448bdb9.tar.bz2
ganv-298bc503de64b3f42f71ecbd6009a32f9448bdb9.zip
Fix errors when port has no label.ganv/src/port.c
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@4249 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/port.c')
-rw-r--r--src/port.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/port.c b/src/port.c
index f377b79..6ce37d0 100644
--- a/src/port.c
+++ b/src/port.c
@@ -189,21 +189,23 @@ ganv_port_resize(GanvNode* self)
GanvPort* port = GANV_PORT(self);
GanvNode* node = GANV_NODE(self);
- double label_w, label_h;
- g_object_get(node->impl->label,
- "width", &label_w,
- "height", &label_h,
- NULL);
-
- ganv_box_set_width(&port->box, MAX(ganv_box_get_width(&port->box),
- label_w + (PORT_LABEL_HPAD * 2.0)));
- ganv_box_set_height(&port->box, MAX(ganv_box_get_height(&port->box),
- label_h + (PORT_LABEL_VPAD * 2.0)));
-
- ganv_item_set(GANV_ITEM(node->impl->label),
- "x", PORT_LABEL_HPAD,
- "y", PORT_LABEL_VPAD,
- NULL);
+ if (node->impl->label) {
+ double label_w, label_h;
+ g_object_get(node->impl->label,
+ "width", &label_w,
+ "height", &label_h,
+ NULL);
+
+ ganv_box_set_width(&port->box, MAX(ganv_box_get_width(&port->box),
+ label_w + (PORT_LABEL_HPAD * 2.0)));
+ ganv_box_set_height(&port->box, MAX(ganv_box_get_height(&port->box),
+ label_h + (PORT_LABEL_VPAD * 2.0)));
+
+ ganv_item_set(GANV_ITEM(node->impl->label),
+ "x", PORT_LABEL_HPAD,
+ "y", PORT_LABEL_VPAD,
+ NULL);
+ }
if (parent_class->parent_class.resize) {
parent_class->parent_class.resize(self);