MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / resize

Method resize

src/bzflag/HUDuiServerListCustomTab.cpp:205–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203
204
205void HUDuiServerListCustomTab::resize() {
206 FontManager& fm = FontManager::instance();
207
208 float _fontheight = fm.getStringHeight(getFontFace()->getFMFace(), getFontSize());
209
210 float y = getY() + getHeight() - _fontheight;
211
212 float spacer = fm.getStringWidth(getFontFace()->getFMFace(), getFontSize(), "XXXI");
213
214 float width = fm.getStringWidth(getFontFace()->getFMFace(), getFontSize(), tabName->getLabel());
215
216 tabName->setFontFace(getFontFace());
217 tabName->setFontSize(getFontSize());
218 tabName->setPosition(getX() + width + spacer, y);
219
220 y = y - _fontheight;
221
222 const int faceID = getFontFace()->getFMFace();
223 const float fontSize = getFontSize();
224
225 width = fm.getStringWidth(faceID, fontSize, domainName->getLabel());
226
227 domainName->setFontFace(getFontFace());
228 domainName->setFontSize(fontSize);
229 domainName->setPosition(getX() + width + spacer, y);
230
231 y = y - _fontheight;
232
233 width = fm.getStringWidth(faceID, fontSize, serverName->getLabel());
234
235 serverName->setFontFace(getFontFace());
236 serverName->setFontSize(fontSize);
237 serverName->setPosition(getX() + width + spacer, y);
238
239 y = y - _fontheight;
240
241 width = fm.getStringWidth(faceID, fontSize, emptyServer->getLabel());
242
243 emptyServer->setFontFace(getFontFace());
244 emptyServer->setFontSize(fontSize);
245 emptyServer->setPosition(getX() + width + spacer, y);
246
247 y = y - _fontheight;
248
249 width = fm.getStringWidth(faceID, fontSize, fullServer->getLabel());
250
251 fullServer->setFontFace(getFontFace());
252 fullServer->setFontSize(fontSize);
253 fullServer->setPosition(getX() + width + spacer, y);
254
255 y = y - _fontheight;
256
257 width = fm.getStringWidth(faceID, fontSize, teamFFAServers->getLabel());
258
259 teamFFAServers->setFontFace(getFontFace());
260 teamFFAServers->setFontSize(fontSize);
261 teamFFAServers->setPosition(getX() + width + spacer, y);
262

Callers

nothing calls this directly

Calls 7

getStringHeightMethod · 0.80
getFMFaceMethod · 0.80
getStringWidthMethod · 0.80
getLabelMethod · 0.80
setFontFaceMethod · 0.45
setFontSizeMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected