MCPcopy Create free account
hub / github.com/gioui/gio / clampScroll

Method clampScroll

io/input/pointer.go:337–341  ·  view source on GitHub ↗

clampScroll splits a scroll distance in the remaining scroll and the scroll accepted by the filter.

(scroll f32.Point)

Source from the content-addressed store, hash-verified

335// clampScroll splits a scroll distance in the remaining scroll and the
336// scroll accepted by the filter.
337func (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
343func clampSplit(v float32, min, max int) (float32, float32) {
344 if m := float32(max); v > m {

Callers 2

DeliverMethod · 0.80
deliverEventMethod · 0.80

Calls 1

clampSplitFunction · 0.85

Tested by

no test coverage detected