MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / maintainSizing

Method maintainSizing

Engine/source/gui/core/guiCanvas.cpp:1685–1728  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1683}
1684
1685void GuiCanvas::maintainSizing()
1686{
1687 Point2I size = getWindowSize();
1688
1689 if(size.x == -1 || size.y == -1)
1690 return;
1691
1692 RectI screenRect(0, 0, size.x, size.y);
1693 setBounds(screenRect);
1694
1695 // all bottom level controls should be the same dimensions as the canvas
1696 // this is necessary for passing mouse events accurately
1697 iterator i;
1698 for (i = begin(); i != end(); i++)
1699 {
1700 AssertFatal(static_cast<GuiControl*>((*i))->isAwake(), "GuiCanvas::maintainSizing - ctrl is not awake");
1701 GuiControl *ctrl = static_cast<GuiControl*>(*i);
1702 Point2I ext = ctrl->getExtent();
1703 Point2I pos = ctrl->getPosition();
1704 Point2I newExt = screenRect.extent;
1705 Point2I newPos = screenRect.point;
1706
1707 // if menubar is active displace content gui control
1708 if (mMenuBarCtrl && (ctrl == getContentControl()))
1709 {
1710 /*const SimObject *menu = mMenuBarCtrl->findObjectByInternalName( StringTable->insert("menubar"), true);
1711
1712 if( !menu )
1713 continue;
1714
1715 AssertFatal( dynamic_cast<const GuiControl*>(menu), "");*/
1716
1717 const U32 yOffset = static_cast<const GuiMenuBar*>(mMenuBarCtrl)->mMenubarHeight;
1718 newPos.y += yOffset;
1719 newExt.y -= yOffset;
1720 }
1721
1722 if (pos != newPos || ext != newExt)
1723 {
1724 ctrl->resize(newPos, newExt);
1725 resetUpdateRegions();
1726 }
1727 }
1728}
1729
1730void GuiCanvas::setupFences()
1731{

Callers

nothing calls this directly

Calls 7

setBoundsFunction · 0.85
beginFunction · 0.85
endFunction · 0.85
getContentControlFunction · 0.85
getExtentMethod · 0.80
getPositionMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected