MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / GUI_Widget_Scrollbar_CalculatePosition

Function GUI_Widget_Scrollbar_CalculatePosition

src/gui/widget.c:869–887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

867}
868
869uint16 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
889uint16 GUI_Widget_Scrollbar_CalculateScrollPosition(WidgetScrollbar *scrollbar)
890{

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected