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

Method _updateView

MyGUIEngine/src/MyGUI_TileRect.cpp:98–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96 }
97
98 void TileRect::_updateView()
99 {
100 bool margin = _checkMargin();
101
102 mEmptyView = ((0 >= _getViewWidth()) || (0 >= _getViewHeight()));
103
104 mCurrentCoord.left = mCoord.left + mMargin.left;
105 mCurrentCoord.top = mCoord.top + mMargin.top;
106 mCurrentCoord.width = _getViewWidth();
107 mCurrentCoord.height = _getViewHeight();
108
109 // подсчитываем необходимое колличество тайлов
110 if (!mEmptyView)
111 {
112 size_t count = 0;
113 if (!mTileSize.empty())
114 {
115 size_t count_x = mCoord.width / mTileSize.width;
116 if ((mCoord.width % mTileSize.width) > 0)
117 count_x++;
118
119 size_t count_y = mCoord.height / mTileSize.height;
120 if ((mCoord.height % mTileSize.height) > 0)
121 count_y++;
122
123 count = count_y * count_x * VertexQuad::VertexCount;
124 }
125
126 // нужно больше вершин
127 if (count > mCountVertex)
128 {
129 mCountVertex = count + TILERECT_COUNT_VERTEX;
130 if (nullptr != mRenderItem)
131 mRenderItem->reallockDrawItem(this, mCountVertex);
132 }
133 }
134
135 // вьюпорт стал битым
136 if (margin)
137 {
138 // проверка на полный выход за границу
139 if (_checkOutside())
140 {
141 // запоминаем текущее состояние
142 mIsMargin = margin;
143
144 // обновить перед выходом
145 if (nullptr != mNode)
146 mNode->outOfDate(mRenderItem);
147 return;
148 }
149 }
150
151 // запоминаем текущее состояние
152 mIsMargin = margin;
153
154 if (nullptr != mNode)
155 mNode->outOfDate(mRenderItem);

Callers

nothing calls this directly

Calls 6

_getViewWidthFunction · 0.85
_getViewHeightFunction · 0.85
_checkOutsideFunction · 0.85
reallockDrawItemMethod · 0.80
emptyMethod · 0.45
outOfDateMethod · 0.45

Tested by

no test coverage detected