MCPcopy Create free account
hub / github.com/angular-rust/ux-components / set_y

Method set_y

src/elements/element.rs:1260–1284  ·  view source on GitHub ↗

The y position of the control bounds, world coordinate

(&self, y: f32)

Source from the content-addressed store, hash-verified

1258
1259 /// The y position of the control bounds, world coordinate
1260 fn set_y(&self, y: f32) {
1261 let mut comp = self.as_ref().borrow_mut();
1262
1263 let dy = y - comp.y;
1264
1265 comp.y = y;
1266
1267 if !comp.ignore_spatial {
1268 comp.ignore_spatial = true;
1269 match comp.parent {
1270 Some(parent) => {
1271 // if let Some(widget) = parent.widget() {
1272 // comp.y_local = comp.y - widget.y(); // TODO: direct or with setter
1273 // }
1274 }
1275 None => {
1276 comp.y_local = comp.y; // TODO: direct or with setter
1277 }
1278 }
1279
1280 comp.ignore_spatial = false;
1281 }
1282
1283 self.bounds_changed(0.0, dy, 0.0, 0.0);
1284 }
1285
1286 /// The minimum width
1287 fn w_min(&self) -> f32 {

Callers 4

update_scrollMethod · 0.80
update_scrollMethod · 0.80
close_listMethod · 0.80
open_listMethod · 0.80

Implementers 15

transform.rssrc/elements/transform.rs
media_query.rssrc/elements/media_query.rs
navigation_toolbar.rssrc/elements/navigation_toolbar.rs
calendar_date_picker.rssrc/elements/calendar_date_picker.rs
custom_scroll_view.rssrc/elements/custom_scroll_view.rs
preferred_size.rssrc/elements/preferred_size.rs
rust_logo.rssrc/elements/rust_logo.rs
panel.rssrc/elements/panel.rs
single_child_scroll_view.rssrc/elements/single_child_scroll_view.
choice_chip.rssrc/elements/choice_chip.rs
tab_page_selector.rssrc/elements/tab_page_selector.rs
align.rssrc/elements/align.rs

Calls 2

as_refMethod · 0.45
bounds_changedMethod · 0.45

Tested by

no test coverage detected