parent
16fe84704b
commit
807ac743fc
|
|
@ -329,14 +329,14 @@ Layout.prototype.update = function() {
|
||||||
l.c.forEach(updateMin);
|
l.c.forEach(updateMin);
|
||||||
l._h = l.c.reduce((a,b)=>Math.max(a,b._h+(b.pad<<1)),0);
|
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);
|
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.fillx == null && l.c.some(c=>c.fillx)) l.fillx = 1;
|
||||||
if (l.c.some(c=>c.filly)) l.filly = 1;
|
if (l.filly == null && l.c.some(c=>c.filly)) l.filly = 1;
|
||||||
}, "v": function(l) {
|
}, "v": function(l) {
|
||||||
l.c.forEach(updateMin);
|
l.c.forEach(updateMin);
|
||||||
l._h = l.c.reduce((a,b)=>a+b._h+(b.pad<<1),0);
|
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);
|
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.fillx == null && l.c.some(c=>c.fillx)) l.fillx = 1;
|
||||||
if (l.c.some(c=>c.filly)) l.filly = 1;
|
if (l.filly == null && l.c.some(c=>c.filly)) l.filly = 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
updateMin(l);
|
updateMin(l);
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
|
|
@ -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"},
|
||||||
|
]},
|
||||||
|
]});
|
||||||
Loading…
Reference in New Issue