| 867 | } |
| 868 | |
| 869 | uint16 GUI_Widget_Scrollbar_CalculatePosition(WidgetScrollbar *scrollbar) |
| 870 | { |
| 871 | Widget *w; |
| 872 | uint16 position; |
| 873 | |
| 874 | w = scrollbar->parent; |
| 875 | if (w == NULL) return 0xFFFF; |
| 876 | |
| 877 | position = scrollbar->scrollMax - scrollbar->scrollPageSize; |
| 878 | |
| 879 | if (position != 0) position = scrollbar->scrollPosition * (max(w->width, w->height) - 2 - scrollbar->size) / position; |
| 880 | |
| 881 | if (scrollbar->position != position) { |
| 882 | scrollbar->position = position; |
| 883 | scrollbar->dirty = 1; |
| 884 | } |
| 885 | |
| 886 | return position; |
| 887 | } |
| 888 | |
| 889 | uint16 GUI_Widget_Scrollbar_CalculateScrollPosition(WidgetScrollbar *scrollbar) |
| 890 | { |
no outgoing calls
no test coverage detected