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

Method _setScrollView

MyGUIEngine/src/MyGUI_ListBox.cpp:784–807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

782 }
783
784 void ListBox::_setScrollView(size_t _position)
785 {
786 mOffsetTop = ((int)_position % mHeightLine);
787
788 // смещение с отрицательной стороны
789 int offset = 0 - mOffsetTop;
790
791 for (auto& widgetLine : mWidgetLines)
792 {
793 widgetLine->setPosition(IntPoint(0, offset));
794 offset += mHeightLine;
795 }
796
797 // если индех изменился, то перерисовываем линии
798 int top = ((int)_position / mHeightLine);
799 if (top != mTopIndex)
800 {
801 mTopIndex = top;
802 _redrawItemRange();
803 }
804
805 // прорисовываем все нижние строки, если они появились
806 _redrawItemRange(mLastRedrawLine);
807 }
808
809 void ListBox::_sendEventChangeScroll(size_t _position)
810 {

Callers

nothing calls this directly

Calls 2

IntPointFunction · 0.50
setPositionMethod · 0.45

Tested by

no test coverage detected