EdgeInsets
Utility class to express insets (padding).
export class EdgeInsets {
left: Float
right: Float
top: Float
bottom: Float
horizontal: Float { get, set }
vertical: Float { get, set }
constructor(_ length: Float)
constructor(horizontal: Float = 0.0, vertical: Float = 0.0)
constructor(left: Float = 0.0, right: Float = 0.0, top: Float = 0.0, bottom: Float = 0.0)
}
import { EdgeInsets } from kontakt_controls
Constructors
(_ length)
Symmetrical inset on all sides.
_ length
Inset length in pixels.
(horizontal:vertical)
Symmetrical inset for left/right and top/bottom.
horizontal: Float = 0
Left and right inset.
vertical: Float = 0
Top and bottom inset.
(left:right:top:bottom)
Custom insets for each side.
left: Float = 0
Left inset.
right: Float = 0
Right inset.
top: Float = 0
Top inset.
bottom: Float = 0
Bottom inset.
Properties
horizontal: Float (get/set)
Sets both left
and right
to the given value. When read returns the sum of left
and right
.
vertical: Float (get/set)
Sets both top
and bottom
to the given value. When read returns the sum of top
and bottom
.
left: Float
Left inset.
right: Float
Right inset.
top: Float
Top inset.
bottom: Float
Bottom inset.
Methods
copy() -> (EdgeInsets)
Returns a copy.
overriding(_ modify: (EdgeInsets) -> ()) -> (EdgeInsets)
Returns a modified version of the insets. Modify the copy inside the modify funtion.
var modified = (EdgeInsets(10)).overriding(fun (insets) {
insets.left = 40
})