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

Method lineInserted

Engine/source/gui/game/guiMessageVectorCtrl.cpp:258–288  ·  view source on GitHub ↗

--------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

256
257//--------------------------------------------------------------------------
258void GuiMessageVectorCtrl::lineInserted(const U32 arg)
259{
260 AssertFatal(mMessageVector != NULL, "Should not be here unless we're attached!");
261
262 GuiScrollCtrl* pScroll = dynamic_cast<GuiScrollCtrl*>(getParent());
263 bool fullyScrolled = pScroll->isScrolledToBottom();
264
265 mSpecialMarkers.insert(arg);
266 createSpecialMarkers(mSpecialMarkers[arg], mMessageVector->getLine(arg).message);
267
268 mLineWrappings.insert(arg);
269 createLineWrapping(mLineWrappings[arg], mMessageVector->getLine(arg).message);
270
271 mLineElements.insert(arg);
272 createLineElement(mLineElements[arg], mLineWrappings[arg], mSpecialMarkers[arg]);
273
274 U32 numLines = 0;
275 for (U32 i = 0; i < mLineWrappings.size(); i++) {
276 // We need to rebuild the physicalLineStart markers at the same time as
277 // we find out how many of them are left...
278 mLineElements[i].physicalLineStart = numLines;
279
280 numLines += mLineWrappings[i].numLines;
281 }
282
283 Point2I newExtent = getExtent();
284 newExtent.y = (mProfile->mFont->getHeight() + mLineSpacingPixels) * getMax(numLines, U32(1));
285 setExtent(newExtent);
286 if(fullyScrolled)
287 pScroll->scrollTo(0, 0x7FFFFFFF);
288}
289
290
291void GuiMessageVectorCtrl::lineDeleted(const U32 arg)

Callers

nothing calls this directly

Calls 7

getMaxFunction · 0.85
setExtentFunction · 0.85
scrollToMethod · 0.80
U32Enum · 0.50
insertMethod · 0.45
sizeMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected