MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / getContentSize

Method getContentSize

src/components/ScrollableContainer.cpp:90–104  ·  view source on GitHub ↗

this should probably return a box to allow for when controls don't start at 0,0

Source from the content-addressed store, hash-verified

88
89//this should probably return a box to allow for when controls don't start at 0,0
90Eigen::Vector2f ScrollableContainer::getContentSize()
91{
92 Eigen::Vector2f max(0, 0);
93 for(unsigned int i = 0; i < mChildren.size(); i++)
94 {
95 Eigen::Vector2f pos(mChildren.at(i)->getPosition()[0], mChildren.at(i)->getPosition()[1]);
96 Eigen::Vector2f bottomRight = mChildren.at(i)->getSize() + pos;
97 if(bottomRight.x() > max.x())
98 max.x() = bottomRight.x();
99 if(bottomRight.y() > max.y())
100 max.y() = bottomRight.y();
101 }
102
103 return max;
104}
105
106void ScrollableContainer::resetAutoScrollTimer()
107{

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
getPositionMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected