| 166 | } |
| 167 | |
| 168 | float ScrollBar::scrollRatio() const { |
| 169 | if (m_parent) { |
| 170 | auto scrollArea = convert<ScrollArea>(m_parent); |
| 171 | if (m_direction == GuiDirection::Vertical) { |
| 172 | if (scrollArea->maxScrollPosition()[1] == 0) |
| 173 | return 0; |
| 174 | return scrollArea->scrollOffset()[1] / (float)(scrollArea->maxScrollPosition()[1]); |
| 175 | } else { |
| 176 | if (scrollArea->maxScrollPosition()[0] == 0) |
| 177 | return 0; |
| 178 | return scrollArea->scrollOffset()[0] / (float)(scrollArea->maxScrollPosition()[0]); |
| 179 | } |
| 180 | } |
| 181 | return 0; |
| 182 | } |
| 183 | |
| 184 | ButtonWidgetPtr ScrollBar::forwardButton() const { |
| 185 | return m_forward; |
nothing calls this directly
no test coverage detected