AUI Framework
develop
Cross-platform base for C++ UI apps
|
Stores dimensions in scalable units (dp, pt, etc...). More...
#include <AUI/Util/AMetric.h>
It's highly recommended to use only Density-independent Pixel unit (_dp
) to make your application correctly handle systems with high DPI. In AUI, all units are density independent except _px
. The only purpose of the _px
unit is to define lines of exact one or two pixels wide.
Recommended way is to use operator literal format:
Common usage:
AMetric can be also initialized via value and unit:
AMetric can be also initialized with zero without unit specified (in this case, AMetric::getUnit will return T_PX):
However, if you try to specify nonzero integer without unit, it will produce a runtime error:
{cpp}
Currently supported units:
Unit | Enum | Literal | Value |
---|---|---|---|
Density-independent Pixels | T_DP | _dp | px * scale_factor |
Typography point | T_PT | _pt | px * scale_factor * 4 / 3 |
Pixels | T_PX | _px | px |
|
inlineconstexpr |
T | integer |
value | should be zero |