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

Method trackSize

source/windowing/StarScrollArea.cpp:137–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137int ScrollBar::trackSize() const {
138 if (m_parent) {
139 auto scrollArea = convert<ScrollArea>(m_parent);
140 auto size = scrollArea->size();
141 if (m_direction == GuiDirection::Vertical) {
142 if (scrollArea->horizontalScroll()) {
143 return size[1] - (ScrollBarTrackOverhead + ScrollAreaBorder);
144 } else {
145 return size[1] - ScrollBarTrackOverhead;
146 }
147 } else {
148 return size[0] - ScrollBarTrackOverhead;
149 }
150 }
151
152 throw GuiException("Somehow have a Scroll Bar without a parent.");
153}
154
155float ScrollBar::sizeRatio() const {
156 if (m_parent) {

Callers

nothing calls this directly

Calls 2

horizontalScrollMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected