Skip to content

Commit

Permalink
scrollbar fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 6, 2019
1 parent b53a650 commit 6453169
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/eez/gui/widgets/scroll_bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ bool setPosition(const WidgetCursor &widgetCursor, int position) {
void getThumbGeometry(int size, int position, int pageSize, int xTrack, int wTrack, int minThumbWidth, int &xThumb, int &widthThumb) {
xThumb = xTrack + (int)floorf(1.0f * position * wTrack / size);
widthThumb = MAX((int)floorf(1.0f * pageSize * wTrack / size), minThumbWidth);
if (xThumb + widthThumb >= xTrack + wTrack) {
xThumb = xTrack + wTrack - widthThumb;
}
}

int getPositionFromThumbPosition(int thumbPosition, int size, int xTrack, int wTrack) {
Expand Down

0 comments on commit 6453169

Please sign in to comment.