src code

constructor new Element.Layout

new Element.Layout(element[, preCompute])
  • element (Element) – The element to be measured.
  • preCompute (Boolean) – Whether to compute all values at once.

Declare a new layout hash.

The preCompute argument determines whether measurements will be lazy-loaded or not. If you plan to use many different measurements, it's often more performant to pre-compute, as it minimizes the amount of overhead needed to measure. If you need only one or two measurements, it's probably not worth it.