MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / sizeRatio

Method sizeRatio

source/windowing/StarScrollArea.cpp:155–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155float ScrollBar::sizeRatio() const {
156 if (m_parent) {
157 auto scrollArea = convert<ScrollArea>(m_parent);
158 if (m_direction == GuiDirection::Vertical) {
159 return scrollArea->contentSize()[1] / (float)(scrollArea->areaSize()[1]);
160 } else {
161 return scrollArea->contentSize()[0] / (float)(scrollArea->areaSize()[0]);
162 }
163 }
164
165 throw GuiException("Somehow have a Scroll Bar without a parent.");
166}
167
168float ScrollBar::scrollRatio() const {
169 if (m_parent) {

Callers

nothing calls this directly

Calls 2

contentSizeMethod · 0.80
areaSizeMethod · 0.80

Tested by

no test coverage detected