Class: SizeController

SizeController

Size controller manages LayoutSystem and it's content size.

new SizeController (layout)

Creates size controller.

Name Type Description
layout LayoutSystem

Layout to control.

Members

height number

Get height of the controlled layout.

height

Set height of the controlled layout. And align children.

width number

Get width of the controlled layout.

width

Set width of the controlled layout. And align children.

innerText Text protected

Get text element if layout is just a wrapper for a text element.

Methods

resize (parentWidth, parentHeight)

Updates layout size and all children sizes

Name Type Attributes Description
parentWidth number <optional>

Parent width

parentHeight number <optional>

Parent height

fitToSize (parentWidth, parentHeight) protected

Fits controlled layout into parent size, scales it down if does not fit.

This method is called when maxWidth or maxHeight is set.

Name Type Description
parentWidth number
parentHeight number

getAutoSizeModificator (size) SizeControl protected

Get type of size control basing on styles and in case if width of the layout is set to auto.

Name Type Description
size FlexNumber | "auto"

Width or height of the layout.

Returns:
Type Description
SizeControl

updateBG (finalWidth, finalHeight) protected

Render and update the background of layout basing on it's current state.

Name Type Description
finalWidth number

Width of the layout.

finalHeight number

Height of the layout.

updateMask () protected

Render and update the mask of layout basing on it's current state. Mask is used to hide overflowing content.