diff --git a/modules/Layout.js b/modules/Layout.js index 521b191b6..bfb13a561 100644 --- a/modules/Layout.js +++ b/modules/Layout.js @@ -329,14 +329,14 @@ Layout.prototype.update = function() { l.c.forEach(updateMin); l._h = l.c.reduce((a,b)=>Math.max(a,b._h+(b.pad<<1)),0); l._w = l.c.reduce((a,b)=>a+b._w+(b.pad<<1),0); - if (l.c.some(c=>c.fillx)) l.fillx = 1; - if (l.c.some(c=>c.filly)) l.filly = 1; + if (l.fillx == null && l.c.some(c=>c.fillx)) l.fillx = 1; + if (l.filly == null && l.c.some(c=>c.filly)) l.filly = 1; }, "v": function(l) { l.c.forEach(updateMin); l._h = l.c.reduce((a,b)=>a+b._h+(b.pad<<1),0); l._w = l.c.reduce((a,b)=>Math.max(a,b._w+(b.pad<<1)),0); - if (l.c.some(c=>c.fillx)) l.fillx = 1; - if (l.c.some(c=>c.filly)) l.filly = 1; + if (l.fillx == null && l.c.some(c=>c.fillx)) l.fillx = 1; + if (l.filly == null && l.c.some(c=>c.filly)) l.filly = 1; } }; updateMin(l); diff --git a/tests/Layout/tests/filly_issue820.bmp b/tests/Layout/tests/filly_issue820.bmp new file mode 100644 index 000000000..886ba97d8 Binary files /dev/null and b/tests/Layout/tests/filly_issue820.bmp differ diff --git a/tests/Layout/tests/filly_issue820.js b/tests/Layout/tests/filly_issue820.js new file mode 100644 index 000000000..4b813fadf --- /dev/null +++ b/tests/Layout/tests/filly_issue820.js @@ -0,0 +1,9 @@ +g.clear(); +var layout = new Layout({type:"h", filly: 0, c: [ + {type: "txt", font: "50%", label: "A"}, + {type:"v", c: [ + {type: "txt", font: "10%", label: "B"}, + {filly: 1}, + {type: "txt", font: "10%", label: "C"}, + ]}, +]});