MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / render_debug_layout_sizing

Method render_debug_layout_sizing

src/engine.rs:7258–7298  ·  view source on GitHub ↗

Render the debug view sizing info for one axis.

(&mut self, sizing: SizingAxis, config_index: usize)

Source from the content-addressed store, hash-verified

7256
7257 /// Render the debug view sizing info for one axis.
7258 fn render_debug_layout_sizing(&mut self, sizing: SizingAxis, config_index: usize) {
7259 let label = match sizing.type_ {
7260 SizingType::Fit => "FIT",
7261 SizingType::Grow => "GROW",
7262 SizingType::Percent => "PERCENT",
7263 SizingType::Fixed => "FIXED",
7264 // Default handled by Grow arm above
7265 };
7266 self.debug_text(label, config_index);
7267 if matches!(sizing.type_, SizingType::Grow | SizingType::Fit | SizingType::Fixed) {
7268 self.debug_text("(", config_index);
7269 let mut wrote_any = false;
7270
7271 if sizing.type_ == SizingType::Grow && !float_equal(sizing.grow_weight, 1.0) {
7272 self.debug_text("weight: ", config_index);
7273 self.debug_float_text(sizing.grow_weight, config_index);
7274 wrote_any = true;
7275 }
7276
7277 if sizing.min_max.min != 0.0 {
7278 if wrote_any {
7279 self.debug_text(", ", config_index);
7280 }
7281 self.debug_text("min: ", config_index);
7282 self.debug_int_text(sizing.min_max.min, config_index);
7283 wrote_any = true;
7284 }
7285 if sizing.min_max.max != MAXFLOAT {
7286 if wrote_any {
7287 self.debug_text(", ", config_index);
7288 }
7289 self.debug_text("max: ", config_index);
7290 self.debug_int_text(sizing.min_max.max, config_index);
7291 }
7292 self.debug_text(")", config_index);
7293 } else if sizing.type_ == SizingType::Percent {
7294 self.debug_text("(", config_index);
7295 self.debug_int_text(sizing.percent * 100.0, config_index);
7296 self.debug_text("%)", config_index);
7297 }
7298 }
7299
7300 /// Render a config type header in the selected element detail panel.
7301 fn render_debug_view_element_config_header(

Calls 4

float_equalFunction · 0.85
debug_textMethod · 0.80
debug_float_textMethod · 0.80
debug_int_textMethod · 0.80

Tested by

no test coverage detected