diff options
author | David Robillard <d@drobilla.net> | 2013-06-08 18:03:36 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-06-08 18:03:36 +0000 |
commit | 423bcd39d6c6e8870128df2715a262bc8e59603f (patch) | |
tree | 7255b0dca7888a4070135c04565a8ac88d413d7f /src/port.c | |
parent | 7559cf81b07509420f1ab85ed95f42f441888df7 (diff) | |
download | ganv-423bcd39d6c6e8870128df2715a262bc8e59603f.tar.gz ganv-423bcd39d6c6e8870128df2715a262bc8e59603f.tar.bz2 ganv-423bcd39d6c6e8870128df2715a262bc8e59603f.zip |
Fix sizing for ports with enumeration or integer tag labels.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5123 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/port.c')
-rw-r--r-- | src/port.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -620,15 +620,24 @@ ganv_port_get_natural_width(const GanvPort* port) { GanvCanvas* const canvas = GANV_CANVAS(GANV_ITEM(port)->canvas); GanvText* const label = port->box.node.impl->label; + double w = 0.0; if (canvas->direction == GANV_DIRECTION_DOWN) { - return ganv_module_get_empty_port_breadth(ganv_port_get_module(port)); + w = ganv_module_get_empty_port_breadth(ganv_port_get_module(port)); } else if (label && (GANV_ITEM(label)->object.flags & GANV_ITEM_VISIBLE)) { double label_w; g_object_get(port->box.node.impl->label, "width", &label_w, NULL); - return label_w + (PORT_LABEL_HPAD * 2.0); + w = label_w + (PORT_LABEL_HPAD * 2.0); } else { - return ganv_module_get_empty_port_depth(ganv_port_get_module(port)); + w = ganv_module_get_empty_port_depth(ganv_port_get_module(port)); } + if (port->impl->control && port->impl->control->label && + (GANV_ITEM(port->impl->control->label)->object.flags + & GANV_ITEM_VISIBLE)) { + double label_w; + g_object_get(port->impl->control->label, "width", &label_w, NULL); + w += (PORT_LABEL_HPAD * 4.0); + } + return w; } GanvModule* |