Home
last modified time | relevance | path

Searched refs:Vector2 (Results 1 – 11 of 11) sorted by relevance

/StarryEngine/starry_toolkit/src/base/
H A Drect.rs1 use super::vector2::Vector2;
27 pub fn top_left_pos(&self) -> Vector2 { in top_left_pos() argument
28 Vector2::new(self.x, self.y) in top_left_pos()
31 pub fn top_pos(&self) -> Vector2 { in top_pos() argument
32 Vector2::new(self.x + self.width as i32 / 2, self.y) in top_pos()
35 pub fn top_right_pos(&self) -> Vector2 { in top_right_pos() argument
36 Vector2::new(self.x + self.width as i32, self.y) in top_right_pos()
39 pub fn left_pos(&self) -> Vector2 { in left_pos() argument
40 Vector2::new(self.x, self.y + self.height as i32 / 2) in left_pos()
43 pub fn center_pos(&self) -> Vector2 { in center_pos() argument
[all …]
H A Dvector2.rs5 pub struct Vector2 { struct
12 impl Vector2 { argument
14 Vector2 { x: x, y: y } in new()
18 impl Add for Vector2 { implementation
19 type Output = Vector2;
21 fn add(self, other: Vector2) -> Self::Output { in add()
22 Vector2 { in add()
29 impl Sub for Vector2 { implementation
30 type Output = Vector2;
32 fn sub(self, other: Vector2) -> Self::Output { in sub()
[all …]
H A Devent.rs1 use super::vector2::Vector2;
8 point: Vector2,
/StarryEngine/starry_toolkit/src/util/
H A Dmod.rs4 base::{panel::Panel, rect::Rect, vector2::Vector2},
22 pivot_offset: Vector2, in align_rect() argument
25 PivotType::None => Vector2::new(0, 0), in align_rect()
42 PivotType::None => Vector2::new(0, 0), in align_rect()
43 PivotType::Bottom => Vector2::new(negative_width / 2, negative_height), in align_rect()
44 PivotType::BottomLeft => Vector2::new(0, negative_height), in align_rect()
45 PivotType::BottomRight => Vector2::new(negative_width, negative_height), in align_rect()
46 PivotType::Center => Vector2::new(negative_width / 2, negative_height / 2), in align_rect()
47 PivotType::Top => Vector2::new(negative_width / 2, 0), in align_rect()
48 PivotType::TopLeft => Vector2::new(0, 0), in align_rect()
[all …]
/StarryEngine/starry_toolkit/src/layout/
H A Dlist.rs11 base::{panel::Panel, rect::Rect, vector2::Vector2},
35 pivot_offset: Cell<Vector2>,
56 pivot_offset: Cell::new(Vector2::new(0, 0)), in new()
121 let align_vector: Vector2; in arrange_elements()
126 Vector2::new(x_offset as i32, y_offset as i32) in arrange_elements()
128 ListElementPivotType::Center => Vector2::new( in arrange_elements()
132 ListElementPivotType::RightOrBottom => Vector2::new( in arrange_elements()
141 Vector2::new(x_offset as i32, y_offset as i32) in arrange_elements()
143 ListElementPivotType::Center => Vector2::new( in arrange_elements()
147 ListElementPivotType::RightOrBottom => Vector2::new( in arrange_elements()
[all …]
H A Dgrid.rs11 base::{event::Event, panel::Panel, rect::Rect, vector2::Vector2},
30 pivot_offset: Cell<Vector2>,
66 pivot_offset: Cell::new(Vector2::new(0, 0)), in new()
225 child.set_pivot_offset(Vector2::new(cols[col].x, rows[row].y)); in arrange_elements()
263 fn pivot_offset(&self) -> &Cell<Vector2> { in pivot_offset() argument
/StarryEngine/starry_toolkit/src/widgets/
H A Dlabel.rs11 base::{panel::Panel, rect::Rect, vector2::Vector2},
34 pivot_offset: Cell<Vector2>,
55 pivot_offset: Cell::new(Vector2::new(0, 0)), in new()
110 Vector2::new(0, 0), in handle_overflow()
146 fn pivot_offset(&self) -> &Cell<Vector2> { in pivot_offset() argument
205 Vector2::new(0, 0), in set_pivot_type()
209 fn set_pivot_offset(&self, pivot_offset: Vector2) { in set_pivot_offset() argument
216 Vector2::new(0, 0), in set_pivot_offset()
233 Vector2::new(0, 0), in arrange_self()
H A Dmod.rs11 base::{event::Event, panel::Panel, rect::Rect, vector2::Vector2},
58 fn pivot_offset(&self) -> &Cell<Vector2>; in pivot_offset() argument
112 fn set_pivot_offset(&self, pivot_offset: Vector2) { in set_pivot_offset() argument
117 fn set_pivot_offset_base(&self, pivot_offset: Vector2) { in set_pivot_offset_base() argument
H A Dimage.rs10 base::{panel::Panel, rect::Rect, vector2::Vector2},
22 pivot_offset: Cell<Vector2>,
48 pivot_offset: Cell::new(Vector2::new(0, 0)), in new_from_image()
106 fn pivot_offset(&self) -> &Cell<Vector2> { in pivot_offset() argument
/StarryEngine/starry_applications/src/asset_manager/code/
H A Dasset_item_list.rs10 base::{panel::Panel, rect::Rect, vector2::Vector2},
23 pivot_offset: Cell<Vector2>,
41 pivot_offset: Cell::new(Vector2::new(0, 0)), in new()
66 name.set_pivot_offset(Vector2::new(20, 0)); in new()
103 fn pivot_offset(&self) -> &Cell<Vector2> { in pivot_offset() argument
H A Dasset_item_grid.rs10 base::{panel::Panel, rect::Rect, vector2::Vector2},
28 pivot_offset: Cell<Vector2>,
47 pivot_offset: Cell::new(Vector2::new(0, 0)), in new()
80 name.set_pivot_offset(Vector2::new(0, -4)); in new()
108 fn pivot_offset(&self) -> &Cell<Vector2> { in pivot_offset() argument