3 var <bounds, <>margin, <>gap;
4 var <>left, <>top, <>maxHeight,<>maxRight;
6 *new { arg bounds, margin, gap;
7 ^super.newCopyArgs(bounds, margin, gap).init
10 gap = gap ? Point(4,4);
11 margin = margin ? Point(4,4);
15 maxRight = left = bounds.left + margin.x;
16 top = bounds.top + margin.y;
20 var height, width,vbounds;
21 vbounds = view.bounds;
22 width = vbounds.width;
23 height = vbounds.height;
24 if ((left + width) > (bounds.right - margin.x), { this.nextLine; });
26 view.bounds = Rect(left, top, width, height);
28 maxRight = max(maxRight,left + width);
29 left = left + width + gap.x;
30 maxHeight = max(maxHeight, height);
33 left = bounds.left + margin.x;
34 top = top + maxHeight + gap.y;
42 ^bounds.insetBy(margin.x * 2,margin.y * 2)
46 left = left + ( d = (b.left - bounds.left));
47 maxRight = maxRight + (d);
48 top = top + (d = (b.top - bounds.top));
49 maxHeight = maxHeight + (d);
51 // and then you need to re-place all views
52 // but nextLine will be broken, see FlowView
56 currentBounds = bounds;
57 currentBounds.height = top + maxHeight;
60 // rounded out to the nearest rect + margin
62 ^Rect(bounds.left,bounds.top,
63 maxRight + margin.x - bounds.left,
64 (top + maxHeight + margin.y ) - bounds.top)
66 // largest allocatable rect starting in the current row
67 // going down as far as possible
70 inb = this.innerBounds;
72 inb.width - (left - inb.left - margin.x),
73 inb.height - (top - inb.top - margin.y))