MCPcopy Index your code
hub / github.com/g3n/engine / setSplit

Method setSplit

gui/splitter.go:175–184  ·  view source on GitHub ↗

setSplit sets the validated and clamped split position from the received value.

(pos float32)

Source from the content-addressed store, hash-verified

173
174// setSplit sets the validated and clamped split position from the received value.
175func (s *Splitter) setSplit(pos float32) {
176
177 if pos < 0 {
178 s.pos = 0
179 } else if pos > 1 {
180 s.pos = 1
181 } else {
182 s.pos = pos
183 }
184}
185
186// update updates the splitter visual state
187func (s *Splitter) update() {

Callers 2

SetSplitMethod · 0.95
onCursorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected