Re: CORRECTION: change to box-packing algorithm?
Adam Megacz <[email protected]> Wed, 07 Apr 2004 00:12:05 -0700
| Newsgroups | gmane.comp.java.xwt.core |
|---|---|
| Organization | XWT |
| Message-ID | <[email protected]> |
(a new personal record: four replies to myself without any intervening posts) David, if you want the "new" behavior in the old system, just make sure rowspan=1 for all the boxes; then the lines of text won't overlap. - a Adam Megacz <[email protected]> writes: > Adam Megacz <[email protected]> writes: >> "a box will be placed as far up and to the left as it can fit and >> still be no higher above and no farther to the left than its >> preceeding sibling" > > Scratch that. > > A box will be placed: > > - no higher than its preceeding sibling > - either > - no farther to the left of its preceeding sibling > - below the bottoms of all of its preceeding siblings > > - as far up and to the left as possible subject to the previous two > constraints. > > Basically this means that the packing algorithm requires O(1) space. > There's a cool algorithm [*] that can do the original form of the > box-packing algorithm in O(numboxes log numboxes) space, but it's a > huge huge pain in the butt. > > This is also the (correct) statement of the intuitive text-reflow > system (when colspan==width). > > - a > > [*] it was actually invented by the people who did the original GUI > Toolbox for the mac... it represents 1-bit bitmaps as an > RLE-encoded array of RLE-encoded arrays. Turns out to be hugely > efficient for bitmaps that are made of big, contiguous rectangles > (which is exactly what the "which-cells-are-taken" map is) > > _______________________________________________ > core mailing list > [email protected] > http://lists.xwt.org/listinfo/core > -- "It's lucky," he added, after a pause, "that there are such a lot of islands in the world. I almost envy you, Mr. Watson." -- Mustapha Mond