?_horizontal:Option , ?_vertical:Option
(&self, horizontal: Option<f32>, vertical: Option<f32>)
| 152 | |
| 153 | // ?_horizontal:Option<f32>, ?_vertical:Option<f32> |
| 154 | pub fn set_scroll_percent(&self, horizontal: Option<f32>, vertical: Option<f32>) { |
| 155 | let mut state = self.state.borrow_mut(); |
| 156 | let percent_v = vertical.unwrap_or(state.percent_v); |
| 157 | let percent_h = horizontal.unwrap_or(state.percent_h); |
| 158 | |
| 159 | state.percent_v = percent_v.clamp(0.0, 1.0); |
| 160 | state.percent_h = percent_h.clamp(0.0, 1.0); |
| 161 | |
| 162 | self.update_scroll(); |
| 163 | } |
| 164 | |
| 165 | pub fn update_container(&self) { |
| 166 | let mut state = self.state.borrow_mut(); |
no test coverage detected