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

Method begin_layout

src/engine.rs:2210–2261  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

2208 }
2209
2210 pub fn begin_layout(&mut self) {
2211 self.initialize_ephemeral_memory();
2212 self.generation += 1;
2213 if self.released_this_frame_generation != self.generation {
2214 self.released_this_frame_ids.clear();
2215 }
2216 self.dynamic_element_index = 0;
2217
2218 // Evict stale text measurement cache entries
2219 self.evict_stale_text_cache();
2220
2221 let root_width = self.layout_dimensions.width;
2222 let root_height = self.layout_dimensions.height;
2223
2224 self.boolean_warnings = BooleanWarnings::default();
2225
2226 let root_id = hash_string("Ply__RootContainer", 0);
2227 self.open_element_with_id(&root_id);
2228
2229 let root_decl = ElementDeclaration {
2230 layout: LayoutConfig {
2231 sizing: SizingConfig {
2232 width: SizingAxis {
2233 type_: SizingType::Fixed,
2234 min_max: SizingMinMax {
2235 min: root_width,
2236 max: root_width,
2237 },
2238 percent: 0.0,
2239 grow_weight: 1.0,
2240 },
2241 height: SizingAxis {
2242 type_: SizingType::Fixed,
2243 min_max: SizingMinMax {
2244 min: root_height,
2245 max: root_height,
2246 },
2247 percent: 0.0,
2248 grow_weight: 1.0,
2249 },
2250 },
2251 ..Default::default()
2252 },
2253 ..Default::default()
2254 };
2255 self.configure_open_element(&root_decl);
2256 self.open_layout_element_stack.push(0);
2257 self.layout_element_tree_roots.push(LayoutElementTreeRoot {
2258 layout_element_index: 0,
2259 ..Default::default()
2260 });
2261 }
2262
2263 pub fn end_layout(&mut self) -> &[InternalRenderCommand<CustomElementData>] {
2264 self.close_element();

Callers 1

beginMethod · 0.80

Calls 5

hash_stringFunction · 0.85
open_element_with_idMethod · 0.80

Tested by

no test coverage detected