constructor new Element.Layout

View source on GitHub →

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

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.