================= Item_Slider_ThumbPosition ================= */
| 7635 | ================= |
| 7636 | */ |
| 7637 | int Item_ListBox_ThumbDrawPosition(itemDef_t *item) |
| 7638 | { |
| 7639 | int min, max; |
| 7640 | |
| 7641 | if (itemCapture == item) |
| 7642 | { |
| 7643 | if (item->window.flags & WINDOW_HORIZONTAL) |
| 7644 | { |
| 7645 | min = item->window.rect.x + SCROLLBAR_SIZE + 1; |
| 7646 | max = item->window.rect.x + item->window.rect.w - 2*SCROLLBAR_SIZE - 1; |
| 7647 | if (DC->cursorx >= min + SCROLLBAR_SIZE/2 && DC->cursorx <= max + SCROLLBAR_SIZE/2) |
| 7648 | { |
| 7649 | return DC->cursorx - SCROLLBAR_SIZE/2; |
| 7650 | } |
| 7651 | else |
| 7652 | { |
| 7653 | return Item_ListBox_ThumbPosition(item); |
| 7654 | } |
| 7655 | } |
| 7656 | else |
| 7657 | { |
| 7658 | min = item->window.rect.y + SCROLLBAR_SIZE + 1; |
| 7659 | max = item->window.rect.y + item->window.rect.h - 2*SCROLLBAR_SIZE - 1; |
| 7660 | if (DC->cursory >= min + SCROLLBAR_SIZE/2 && DC->cursory <= max + SCROLLBAR_SIZE/2) |
| 7661 | { |
| 7662 | return DC->cursory - SCROLLBAR_SIZE/2; |
| 7663 | } |
| 7664 | else |
| 7665 | { |
| 7666 | return Item_ListBox_ThumbPosition(item); |
| 7667 | } |
| 7668 | } |
| 7669 | } |
| 7670 | else |
| 7671 | { |
| 7672 | return Item_ListBox_ThumbPosition(item); |
| 7673 | } |
| 7674 | } |
| 7675 | |
| 7676 | /* |
| 7677 | ================= |
no test coverage detected