setSplit sets the validated and clamped split position from the received value.
(pos float32)
| 173 | |
| 174 | // setSplit sets the validated and clamped split position from the received value. |
| 175 | func (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 |
| 187 | func (s *Splitter) update() { |