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

Method set_x

src/elements/element.rs:1227–1250  ·  view source on GitHub ↗

The x position of the control bounds, world coordinate

(&self, x: f32)

Source from the content-addressed store, hash-verified

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 {

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 3

as_refMethod · 0.45
xMethod · 0.45
bounds_changedMethod · 0.45

Tested by

no test coverage detected