MCPcopy Create free account
hub / github.com/cogentcore/core / ScrollUpdateFromGeom

Method ScrollUpdateFromGeom

core/scroll.go:111–120  ·  view source on GitHub ↗

ScrollUpdateFromGeom updates the scrollbar for given dimension based on the current Geom.Scroll value for that dimension. This can be used to programatically update the scroll value.

(d math32.Dims)

Source from the content-addressed store, hash-verified

109// based on the current Geom.Scroll value for that dimension.
110// This can be used to programatically update the scroll value.
111func (fr *Frame) ScrollUpdateFromGeom(d math32.Dims) {
112 if !fr.HasScroll[d] || fr.scrolls[d] == nil {
113 return
114 }
115 sb := fr.scrolls[d]
116 cv := fr.Geom.Scroll.Dim(d)
117 sb.setValueEvent(-cv)
118 fr.This.(Layouter).ApplyScenePos() // computes updated positions
119 fr.NeedsRender()
120}
121
122// ScrollValues returns the maximum size that could be scrolled,
123// the visible size (which could be less than the max size, in which

Callers 2

syncEditorsMethod · 0.80
syncEditorsMethod · 0.80

Calls 4

NeedsRenderMethod · 0.80
ApplyScenePosMethod · 0.65
DimMethod · 0.45
setValueEventMethod · 0.45

Tested by

no test coverage detected