()
| 3554 | } |
| 3555 | |
| 3556 | func (s *Scrollbar) DrawOnTop() { |
| 3557 | |
| 3558 | rect := s.Rect |
| 3559 | if s.WorldSpace { |
| 3560 | rect = globals.Project.Camera.TranslateRect(rect) |
| 3561 | } |
| 3562 | |
| 3563 | headRect := *rect |
| 3564 | |
| 3565 | if s.Vertical() { |
| 3566 | scroll := s.Rect.H*s.Value - (12 * s.Value) |
| 3567 | headRect.X = rect.X + 4 |
| 3568 | headRect.Y = rect.Y + 4 + scroll |
| 3569 | } else { |
| 3570 | scroll := s.Rect.W*s.Value - (12 * s.Value) |
| 3571 | headRect.X = rect.X + 4 + scroll |
| 3572 | headRect.Y = rect.Y + 4 |
| 3573 | } |
| 3574 | |
| 3575 | if (s.MouseClose || s.Dragging) && s.DisplayValue { |
| 3576 | // gfx.RoundedBoxColor(globals.Renderer, x, y, x+64, y+48, 4, getThemeColor(GUICompletedColor).SDLColor()) |
| 3577 | |
| 3578 | DrawLabel(Vector{headRect.X - 16, headRect.Y - 16}, 1, fmt.Sprintf("%.0f%%", (s.ValueMin+(s.ValueMax-s.ValueMin)*s.TargetValue)*100), getThemeColor(GUIMenuColor)) |
| 3579 | } |
| 3580 | |
| 3581 | } |
| 3582 | |
| 3583 | func (s *Scrollbar) Vertical() bool { return s.Rect.H > s.Rect.W } |
| 3584 |
nothing calls this directly
no test coverage detected