CORRECTION: change to box-packing algorithm?

Adam Megacz <[email protected]> Wed, 07 Apr 2004 00:07:42 -0700
Newsgroups gmane.comp.java.xwt.core
Organization XWT
Message-ID <[email protected]>
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)