MCPcopy Create free account
hub / github.com/PerroEngine/Perro / screen_min_max

Method screen_min_max

perro_source/render_stack/perro_render_bridge/src/ui.rs:14–25  ·  view source on GitHub ↗
(self, viewport: [f32; 2])

Source from the content-addressed store, hash-verified

12
13impl UiRectState {
14 pub fn screen_min_max(self, viewport: [f32; 2]) -> ([f32; 2], [f32; 2]) {
15 let screen_center = [viewport[0] * 0.5, viewport[1] * 0.5];
16 let center = [
17 screen_center[0] + self.center[0],
18 screen_center[1] - self.center[1],
19 ];
20 let half = [self.size[0] * 0.5, self.size[1] * 0.5];
21 (
22 [center[0] - half[0], center[1] - half[1]],
23 [center[0] + half[0], center[1] + half[1]],
24 )
25 }
26}
27
28#[derive(Debug, Clone, Copy, PartialEq)]

Callers 10

push_ui_shapeFunction · 0.80
push_color_wheel_shapeFunction · 0.80
push_checkbox_shapesFunction · 0.80
push_nine_slice_shapesFunction · 0.80
push_image_shapeFunction · 0.80
push_harfbuzz_text_shapeFunction · 0.80
push_panel_shapeFunction · 0.80
push_text_edit_shapesFunction · 0.80
push_text_shapeFunction · 0.80

Calls

no outgoing calls