The x position of the control bounds, world coordinate
(&self, x: f32)
| 1225 | |
| 1226 | /// The x position of the control bounds, world coordinate |
| 1227 | fn set_x(&self, x: f32) { |
| 1228 | let mut comp = self.as_ref().borrow_mut(); |
| 1229 | |
| 1230 | let dx = x - self.x(); |
| 1231 | |
| 1232 | comp.x = x; |
| 1233 | |
| 1234 | if !comp.ignore_spatial { |
| 1235 | comp.ignore_spatial = true; |
| 1236 | match comp.parent { |
| 1237 | Some(parent) => { |
| 1238 | // if let Some(widget) = parent.widget() { |
| 1239 | // comp.x_local = comp.x - widget.x(); // TODO: direct or with setter |
| 1240 | // } |
| 1241 | } |
| 1242 | None => { |
| 1243 | comp.x_local = comp.x; // TODO: direct or with setter |
| 1244 | } |
| 1245 | } |
| 1246 | comp.ignore_spatial = false; |
| 1247 | } |
| 1248 | |
| 1249 | self.bounds_changed(dx, 0.0, 0.0, 0.0); |
| 1250 | } |
| 1251 | |
| 1252 | /// The y position of the control bounds, world coordinate |
| 1253 | fn y(&self) -> f32 { |
no test coverage detected