15 if (!_textureSize.width || !_textureSize.height)
18 (float)_coord.left / (
float)_textureSize.width,
19 (float)_coord.top / (
float)_textureSize.height,
20 (float)_coord.right() / (float)_textureSize.width,
21 (
float)_coord.bottom() / (float)_textureSize.height};
27 int(_coord.left * _view.width),
28 int(_coord.top * _view.height),
29 int(_coord.width * _view.width),
30 int(_coord.height * _view.height)};
35 return {int(_size.width * _view.width), int(_size.height * _view.height)};
40 return {int(_point.left * _view.width), int(_point.top * _view.height)};
46 _coord.left / (float)_view.width,
47 _coord.top / (
float)_view.height,
48 _coord.width / (float)_view.width,
49 _coord.height / (
float)_view.height};
54 return {_size.width / (float)_view.width, _size.height / (
float)_view.height};
59 return {_point.left / (float)_view.width, _point.top / (
float)_view.height};
65 int(_coord.left * _view.width),
66 int(_coord.top * _view.height),
67 int(_coord.width * _view.width),
68 int(_coord.height * _view.height)};
74 _coord.left / (double)_view.width,
75 _coord.top / (
double)_view.height,
76 _coord.width / (double)_view.width,
77 _coord.height / (
double)_view.height};
80 std::tuple<IntCoord, bool, bool> CoordConverter::applyAlign(
90 if (_align.isHStretch())
92 result.width = _coord.width + (_parentSize.width - _oldsize.width);
95 else if (_align.isRight())
97 result.left = _coord.left + (_parentSize.width - _oldsize.width);
100 else if (_align.isHCenter())
102 result.left = (_parentSize.width - _coord.width) / 2;
106 if (_align.isVStretch())
108 result.height = _coord.height + (_parentSize.height - _oldsize.height);
111 else if (_align.isBottom())
113 result.top = _coord.top + (_parentSize.height - _oldsize.height);
116 else if (_align.isVCenter())
118 result.top = (_parentSize.height - _coord.height) / 2;
122 return {result, resize, move};
types::TPoint< int > IntPoint
types::TCoord< float > FloatCoord
types::TRect< float > FloatRect
types::TCoord< double > DoubleCoord
types::TPoint< float > FloatPoint
types::TSize< float > FloatSize
types::TCoord< int > IntCoord
types::TSize< int > IntSize