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

Method scrollTo

Engine/source/gui/containers/guiScrollCtrl.cpp:535–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

533//-----------------------------------------------------------------------------
534
535void GuiScrollCtrl::scrollTo(S32 x, S32 y)
536{
537 if( !size() )
538 return;
539
540 if ( x == mChildRelPos.x && y == mChildRelPos.y )
541 return;
542
543 setUpdate();
544 if (x > mChildExt.x - mContentExt.x)
545 x = mChildExt.x - mContentExt.x;
546 if (x < 0)
547 x = 0;
548
549 if (y > mChildExt.y - mContentExt.y)
550 y = mChildExt.y - mContentExt.y;
551 if (y < 0)
552 y = 0;
553
554 Point2I delta(x - mChildRelPos.x, y - mChildRelPos.y);
555 mChildRelPos += delta;
556 mChildPos -= delta;
557
558 for(SimSet::iterator i = begin(); i != end();i++)
559 {
560 GuiControl *ctrl = (GuiControl *) (*i);
561 ctrl->setPosition( ctrl->getPosition() - delta );
562 }
563 calcThumbs();
564
565 onScroll_callback();
566}
567
568//-----------------------------------------------------------------------------
569

Callers 5

jquery.jsFile · 0.80
lineInsertedMethod · 0.80
guiScrollCtrl.cppFile · 0.80
setupAutoScrollMethod · 0.80
setupAutoScrollMethod · 0.80

Calls 5

beginFunction · 0.85
endFunction · 0.85
sizeFunction · 0.50
setPositionMethod · 0.45
getPositionMethod · 0.45

Tested by

no test coverage detected