MCPcopy Create free account
hub / github.com/MyGUI/mygui / _setAlign

Method _setAlign

MyGUIEngine/src/MyGUI_RotatingSkin.cpp:74–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 }
73
74 void RotatingSkin::_setAlign(const IntSize& _oldsize)
75 {
76 // первоначальное выравнивание
77 if (mAlign.isHStretch())
78 {
79 // растягиваем
80 mCoord.width = mCoord.width + (mCroppedParent->getWidth() - _oldsize.width);
81 mIsMargin = true; // при изменении размеров все пересчитывать
82 }
83 else if (mAlign.isRight())
84 {
85 // двигаем по правому краю
86 mCoord.left = mCoord.left + (mCroppedParent->getWidth() - _oldsize.width);
87 }
88 else if (mAlign.isHCenter())
89 {
90 // выравнивание по горизонтали без растяжения
91 mCoord.left = (mCroppedParent->getWidth() - mCoord.width) / 2;
92 }
93
94 if (mAlign.isVStretch())
95 {
96 // растягиваем
97 mCoord.height = mCoord.height + (mCroppedParent->getHeight() - _oldsize.height);
98 mIsMargin = true; // при изменении размеров все пересчитывать
99 }
100 else if (mAlign.isBottom())
101 {
102 // двигаем по нижнему краю
103 mCoord.top = mCoord.top + (mCroppedParent->getHeight() - _oldsize.height);
104 }
105 else if (mAlign.isVCenter())
106 {
107 // выравнивание по вертикали без растяжения
108 mCoord.top = (mCroppedParent->getHeight() - mCoord.height) / 2;
109 }
110
111 mCurrentCoord = mCoord;
112 _updateView();
113 }
114
115 void RotatingSkin::_updateView()
116 {

Callers

nothing calls this directly

Calls 3

_updateViewFunction · 0.85
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected