arrange method

void arrange(
  1. Panel panel,
  2. Array<GraphObject> elements,
  3. Rect union
)

After measuring, a Panel must arrange each element, giving the elements a position and size in the Panel's coordinate system. This must call #arrangeElement with each Panel element, which will set that element's GraphObject#actualBounds.

For arranging some elements, it is useful to know the total unioned area of every element, which is given as the union argument. This Rect can be used to right-align or center-align, etc, elements within an area.

For example, PanelLayoutHorizontal arranges each element sequentially, starting with an x value of 0, and increasing it by each previous element's GraphObject#measuredBounds width. The horizontal Panel arranges each element with a y value determined by the union argument's height considering the GraphObject#alignment of the element, and the GraphObject's own measuredBounds.height.

@expose @param {Panel} panel Panel which called this layout @param {Array.

Implementation

void arrange(
  _i3.Panel panel,
  _i7.Array<_i3.GraphObject> elements,
  _i3.Rect union,
) {
  _i4.callMethod(
    this,
    'arrange',
    [
      panel,
      elements,
      union,
    ],
  );
}