func (s *ScrollBar) positionAt(p math.Point) int { o := s.orientation frac := float32(o.Major(p.XY())) / float32(o.Major(s.Size().WH())) max := s.ScrollLimit() return int(float32(max) * frac) }