scrollActionDelta moves the scrollbar in given dimension by given delta. returns whether actually scrolled.
(d math32.Dims, delta float32)
| 200 | // scrollActionDelta moves the scrollbar in given dimension by given delta. |
| 201 | // returns whether actually scrolled. |
| 202 | func (fr *Frame) scrollActionDelta(d math32.Dims, delta float32) bool { |
| 203 | if fr.HasScroll[d] && fr.scrolls[d] != nil { |
| 204 | sb := fr.scrolls[d] |
| 205 | nval := sb.Value + sb.scrollScale(delta) |
| 206 | chg := sb.setValueEvent(nval) |
| 207 | if chg { |
| 208 | fr.NeedsRender() // only render needed -- scroll updates pos |
| 209 | } |
| 210 | return chg |
| 211 | } |
| 212 | return false |
| 213 | } |
| 214 | |
| 215 | // scrollDelta processes a scroll event. If only one dimension is processed, |
| 216 | // and there is a non-zero in other, then the consumed dimension is reset to 0 |
no test coverage detected