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

Method inset

perro_source/core/perro_ui/src/layout.rs:53–58  ·  view source on GitHub ↗
(self, inset: UiRect)

Source from the content-addressed store, hash-verified

51 }
52
53 pub fn inset(self, inset: UiRect) -> Self {
54 let min = self.min() + Vector2::new(inset.left, inset.bottom);
55 let max = self.max() - Vector2::new(inset.right, inset.top);
56 let size = Vector2::new((max.x - min.x).max(0.0), (max.y - min.y).max(0.0));
57 Self::new(min + size * 0.5, size)
58 }
59}
60
61#[derive(Clone, Copy, Debug, PartialEq)]

Callers 7

compute_ui_rectMethod · 0.80
compute_ui_child_rectMethod · 0.80
ui_scroll_content_rectFunction · 0.80
ui_scroll_child_rectFunction · 0.80

Calls 2

minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected