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

Method _checkAlign

MyGUIEngine/src/MyGUI_ListBox.cpp:830–851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

828 }
829
830 void ListBox::_checkAlign()
831 {
832 // максимальная высота всех строк
833 int max_height = mItemsInfo.size() * mHeightLine;
834 // видимая высота
835 int visible_height = _getClientWidget()->getHeight();
836
837 // все строки помещаются
838 if (visible_height >= max_height)
839 {
840 MYGUI_ASSERT(mTopIndex == 0, "mTopIndex == 0");
841 MYGUI_ASSERT(mOffsetTop == 0, "mOffsetTop == 0");
842 int height = 0;
843 for (size_t pos = 0; pos < mWidgetLines.size(); pos++)
844 {
845 if (pos >= mItemsInfo.size())
846 break;
847 MYGUI_ASSERT(mWidgetLines[pos]->getTop() == height, "mWidgetLines[pos]->getTop() == height");
848 height += mWidgetLines[pos]->getHeight();
849 }
850 }
851 }
852
853 size_t ListBox::findItemIndexWith(const UString& _name)
854 {

Callers 1

checkListMethod · 0.80

Calls 3

getTopMethod · 0.80
sizeMethod · 0.45
getHeightMethod · 0.45

Tested by 1

checkListMethod · 0.64