summaryrefslogtreecommitdiffstats
path: root/src/module.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-04 17:23:29 +0000
committerDavid Robillard <d@drobilla.net>2014-01-04 17:23:29 +0000
commit6e6fd7e4242e66e1a579376d8594e78fb0c80c81 (patch)
treea897d78a93dd1bf6f6af705077b44333a86f61b0 /src/module.c
parentba39dcc8ff1567b34773060c2d5de7f50f8c8056 (diff)
downloadganv-6e6fd7e4242e66e1a579376d8594e78fb0c80c81.tar.gz
ganv-6e6fd7e4242e66e1a579376d8594e78fb0c80c81.tar.bz2
ganv-6e6fd7e4242e66e1a579376d8594e78fb0c80c81.zip
Fix sizing of vertical modules with embedded widgets.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5259 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/module.c')
-rw-r--r--src/module.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/module.c b/src/module.c
index 507da22..8a744f3 100644
--- a/src/module.c
+++ b/src/module.c
@@ -169,6 +169,12 @@ measure(GanvModule* module, Metrics* m)
m->width = MAX(contents_width, ports_width);
m->width = MAX(m->width, impl->embed_width);
+
+ if (impl->embed_item) {
+ fprintf(stderr, "DOWN EMBED %lf %lf\n", impl->embed_width, m->width);
+ m->width = MAX(impl->embed_width + 2.0 * PAD, m->width);
+ m->embed_x = PAD;
+ }
return;
}
@@ -176,9 +182,7 @@ measure(GanvModule* module, Metrics* m)
// side that the port isn't right on the edge).
const double hor_pad = (canvas_title ? 10.0 : 20.0);
- m->width = (canvas_title)
- ? title_w + 10.0
- : 1.0;
+ m->width = (canvas_title) ? title_w + 10.0 : 1.0;
// Title is wide, put inputs and outputs beside each other
m->horiz = (impl->widest_input + impl->widest_output + 10.0
@@ -380,9 +384,7 @@ resize_down(GanvModule* module)
}
ganv_box_set_height(GANV_BOX(module), height);
- ganv_box_set_width(GANV_BOX(module),
- MAX(title_w, MAX(in_x, out_x) + port_breadth) + PAD);
-
+ ganv_box_set_width(GANV_BOX(module), m.width);
place_title(module, GANV_DIRECTION_DOWN);
}