Home
last modified time | relevance | path

Searched refs:rect (Results 1 – 19 of 19) sorted by relevance

/StarryEngine/starry_server/src/base/
H A Dimage.rs12 use super::rect::Rect;
17 rect: Rect, field
30 if self.i < self.rect.height() { in next()
31 let start = (self.rect.top() + self.i) * self.w + self.rect.left(); in next()
32 let end = start + self.rect.width(); in next()
44 rect: Rect, field
57 if self.i < self.rect.height() { in next()
63 .split_at_mut(self.rect.top() as usize * self.w as usize) in next()
70 let start = self.rect.left() as usize; in next()
71 let end = self.rect.left() as usize + self.rect.width() as usize; in next()
[all …]
H A Ddisplay.rs5 rect::Rect,
34 pub fn rect(&mut self, rect: &Rect, color: Color) { in rect() method
35 self.image.rect( in rect()
36 rect.left() - self.x, in rect()
37 rect.top() - self.y, in rect()
38 rect.width().try_into().unwrap_or(0), in rect()
39 rect.height().try_into().unwrap_or(0), in rect()
52 pub fn roi(&mut self, rect: &Rect) -> ImageRoi { in roi()
55 rect.left() - self.x, in roi()
56 rect.top() - self.y, in roi()
[all …]
H A Dwindow.rs7 use super::{display::Display, image::Image, rect::Rect};
79 pub fn rect(&self) -> Rect { in rect() method
92 pub fn draw(&mut self, display: &mut Display, rect: &Rect) { in draw()
93 let self_rect = self.rect(); in draw()
94 let intersect = self_rect.intersection(rect); in draw()
H A Dmod.rs3 pub mod rect; module
/StarryEngine/starry_toolkit/src/base/
H A Dpanel.rs19 use super::{event::Event, rect::Rect};
85 rect: Cell<Rect>, field
103 pub fn new(rect: Rect, title: &str, color: Color) -> Arc<Panel> { in new()
105 Window::new(rect.x, rect.y, rect.width, rect.height, title, color), in new()
106 rect, in new()
110 pub fn from_window(window: Window, rect: Rect) -> Arc<Panel> { in from_window()
114 rect: Cell::new(rect), in from_window()
161 pub fn rect(&self) -> Rect { in rect() method
162 self.rect.get() in rect()
238 Self::draw_rect_wireframe(renderer, widget.rect().get(), Color::rgb(0, 0, 0)); in draw_widget()
[all …]
H A Dmod.rs3 pub mod rect; module
/StarryEngine/starry_server/src/core/
H A Dcompositor.rs10 use crate::base::rect::Rect;
73 let rect = original_rect.intersection(&display.screen_rect()); in redraw_all() localVariable
74 if !rect.is_empty() { in redraw_all()
89 window.draw(display, &rect); in redraw_all()
94 let cursor_intersect = rect.intersection(&cursor_rect); in redraw_all()
140 pub fn request_redraw(&self, rect: Rect) { in request_redraw()
144 for rect in self.redraws.borrow_mut().iter_mut() { in request_redraw()
145 let container = rect.container(&rect); in request_redraw()
146 if container.area() <= rect.area() + rect.area() { in request_redraw()
147 *rect = container; in request_redraw()
[all …]
H A Dwindow_manager.rs15 rect::Rect,
140 compositor.request_redraw(window.rect()); in window_new()
/StarryEngine/starry_toolkit/src/widgets/
H A Dmod.rs11 base::{event::Event, panel::Panel, rect::Rect, vector2::Vector2},
52 fn rect(&self) -> &Cell<Rect>; in rect() method
128 let mut rect = self.rect().get(); in resize_base() localVariable
129 rect.width = width; in resize_base()
130 rect.height = height; in resize_base()
131 self.rect().set(rect); in resize_base()
153 self.parent().borrow().clone().unwrap().rect().get() in arrange_self_base()
156 self.panel().borrow().clone().unwrap().rect() in arrange_self_base()
163 self.rect().get(), in arrange_self_base()
169 self.rect().set(target_rect); in arrange_self_base()
H A Dlabel.rs11 base::{panel::Panel, rect::Rect, vector2::Vector2},
32 rect: Cell<Rect>, field
53 rect: Cell::new(Rect::default()), in new()
87 let rect = self.rect.get(); in handle_overflow() localVariable
89 if text.len() as u32 * 8 > rect.width { in handle_overflow()
90 let max_count = max(0, (rect.width as i32 - 3 * 8) / 8); in handle_overflow()
108 self.rect.get(), in handle_overflow()
138 fn rect(&self) -> &Cell<Rect> { in rect() method
139 &self.rect in rect()
186 self.panel().borrow().clone().unwrap().rect(), in draw()
[all …]
H A Dimage.rs10 base::{panel::Panel, rect::Rect, vector2::Vector2},
20 rect: Cell<Rect>, field
46 rect: Cell::new(Rect::new(0, 0, image.width() as u32, image.height() as u32)), in new_from_image()
78 self.rect.get().width as i32, in set_from_color()
79 self.rect.get().height as i32, in set_from_color()
98 fn rect(&self) -> &Cell<Rect> { in rect() method
99 &self.rect in rect()
125 let panel_rect = self.panel.borrow().clone().unwrap().rect(); in draw()
126 let local_rect = get_local_rect(self.rect.get(), panel_rect); in draw()
/StarryEngine/starry_toolkit/src/layout/
H A Dlist.rs11 base::{panel::Panel, rect::Rect, vector2::Vector2},
33 rect: Cell<Rect>, field
54 rect: Cell::new(Rect::default()), in new()
109 max_size = u32::max(max_size, element.rect().get().height); in arrange_elements()
112 max_size = u32::max(max_size, element.rect().get().width); in arrange_elements()
130 y_offset as i32 + (max_size - element.rect().get().height) as i32 / 2, in arrange_elements()
134 y_offset as i32 + (max_size - element.rect().get().height) as i32, in arrange_elements()
144 x_offset as i32 + (max_size - element.rect().get().width) as i32 / 2, in arrange_elements()
148 x_offset as i32 + (max_size - element.rect().get().width) as i32, in arrange_elements()
161 x_offset += element.rect().get().width + self.space.get(); in arrange_elements()
[all …]
H A Dgrid.rs11 base::{event::Event, panel::Panel, rect::Rect, vector2::Vector2},
28 rect: Cell<Rect>, field
64 rect: Cell::new(Rect::default()), in new()
186 let rect = entry.rect().get(); in arrange_elements() localVariable
187 if rect.width >= cols[col].width { in arrange_elements()
188 cols[col as usize].width = rect.width; in arrange_elements()
190 if rect.width >= rows[row].width { in arrange_elements()
191 rows[row as usize].width = rect.width; in arrange_elements()
193 if rect.height >= cols[col].height { in arrange_elements()
194 cols[col as usize].height = rect.height; in arrange_elements()
[all …]
/StarryEngine/starry_client/src/base/
H A Drenderer.rs232 self.rect(x0 - x, y0 + y, x as u32, 1, color); in arc()
235 self.rect(x0, y0 + y, x as u32 + 1, 1, color); in arc()
238 self.rect(x0 - y, y0 + x, y as u32, 1, color); in arc()
241 self.rect(x0, y0 + x, y as u32 + 1, 1, color); in arc()
244 self.rect(x0 - x, y0 - y, x as u32, 1, color); in arc()
247 self.rect(x0, y0 - y, x as u32 + 1, 1, color); in arc()
250 self.rect(x0 - y, y0 - x, y as u32, 1, color); in arc()
253 self.rect(x0, y0 - x, y as u32 + 1, 1, color); in arc()
347 self.rect(x0 - x, y0 + y, x as u32 * 2 + 1, 1, color); in line4points()
350 self.rect(x0 - x, y0 - y, x as u32 * 2 + 1, 1, color); in line4points()
[all …]
/StarryEngine/starry_applications/src/asset_manager/code/
H A Dasset_item_list.rs10 base::{panel::Panel, rect::Rect, vector2::Vector2},
21 pub rect: Cell<Rect>, field
39 rect: Cell::new(Rect::new(0, 0, Self::ITEM_WIDTH, Self::ITEM_HEIGHT)), in new()
95 fn rect(&self) -> &Cell<Rect> { in rect() method
96 &self.rect in rect()
H A Dasset_item_grid.rs10 base::{panel::Panel, rect::Rect, vector2::Vector2},
26 pub rect: Cell<Rect>, field
45 rect: Cell::new(Rect::new(0, 0, Self::ITEM_WIDTH, Self::ITEM_HEIGHT)), in new()
100 fn rect(&self) -> &Cell<Rect> { in rect() method
101 &self.rect in rect()
H A Dmod.rs9 base::{panel::Panel, rect::Rect},
/StarryEngine/starry_toolkit/src/
H A Dmain.rs5 rect::Rect,
/StarryEngine/starry_toolkit/src/util/
H A Dmod.rs4 base::{panel::Panel, rect::Rect, vector2::Vector2},