clampScroll splits a scroll distance in the remaining scroll and the scroll accepted by the filter.
(scroll f32.Point)
| 335 | // clampScroll splits a scroll distance in the remaining scroll and the |
| 336 | // scroll accepted by the filter. |
| 337 | func (p *pointerFilter) clampScroll(scroll f32.Point) (left, scrolled f32.Point) { |
| 338 | left.X, scrolled.X = clampSplit(scroll.X, p.scrollX.Min, p.scrollX.Max) |
| 339 | left.Y, scrolled.Y = clampSplit(scroll.Y, p.scrollY.Min, p.scrollY.Max) |
| 340 | return |
| 341 | } |
| 342 | |
| 343 | func clampSplit(v float32, min, max int) (float32, float32) { |
| 344 | if m := float32(max); v > m { |
no test coverage detected