Struct Length
Represents length with specified measurement unit
struct Length
Constructors
Name | Description |
---|---|
this
(value, type)
|
Construct with some value and type |
Methods
Name | Description |
---|---|
is_em
()
|
|
is_percent
()
|
|
is_rem
()
|
|
opBinary
(u)
|
|
opBinary
(factor)
|
|
opEquals
(u)
|
|
toDevice
()
|
For absolute units - converts them to device pixels, for relative - multiplies by 100 |
toLayout
()
|
Convert to layout length, which represents device-independent pixels or percentage |
Static methods
Name | Description |
---|---|
cm
(value)
|
|
device
(value)
|
Construct with raw device pixels |
dipToDevice
(dips)
|
Convert device-independent pixels to physical device pixels (of current window) |
em
(value)
|
|
inch
(value)
|
|
mm
(value)
|
|
parse
(value, unit)
|
Parse pair (value, unit), where value is a real number, unit is: cm, mm, in, pt, px, em, %.
Returns Length if cannot parse.
|
percent
(value)
|
|
pt
(value)
|
|
px
(value)
|
|
rem
(value)
|