| 153 | } |
| 154 | |
| 155 | float 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 | |
| 168 | float ScrollBar::scrollRatio() const { |
| 169 | if (m_parent) { |
nothing calls this directly
no test coverage detected