| 7530 | } |
| 7531 | |
| 7532 | int Item_TextScroll_ThumbPosition ( itemDef_t *item ) |
| 7533 | { |
| 7534 | float max, pos, size; |
| 7535 | textScrollDef_t *scrollPtr = (textScrollDef_t*)item->typeData; |
| 7536 | |
| 7537 | max = Item_TextScroll_MaxScroll ( item ); |
| 7538 | size = item->window.rect.h - (SCROLLBAR_SIZE * 2) - 2; |
| 7539 | |
| 7540 | if (max > 0) |
| 7541 | { |
| 7542 | pos = (size-SCROLLBAR_SIZE) / (float) max; |
| 7543 | } |
| 7544 | else |
| 7545 | { |
| 7546 | pos = 0; |
| 7547 | } |
| 7548 | |
| 7549 | pos *= scrollPtr->startPos; |
| 7550 | |
| 7551 | return item->window.rect.y + 1 + SCROLLBAR_SIZE + pos; |
| 7552 | } |
| 7553 | |
| 7554 | int Item_TextScroll_ThumbDrawPosition ( itemDef_t *item ) |
| 7555 | { |
no test coverage detected