diff options
author | David Robillard <d@drobilla.net> | 2014-01-04 17:23:29 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-01-04 17:23:29 +0000 |
commit | 6e6fd7e4242e66e1a579376d8594e78fb0c80c81 (patch) | |
tree | a897d78a93dd1bf6f6af705077b44333a86f61b0 /src | |
parent | ba39dcc8ff1567b34773060c2d5de7f50f8c8056 (diff) | |
download | ganv-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')
-rw-r--r-- | src/module.c | 14 |
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); } |