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

Method open_element_with_id

src/engine.rs:1266–1294  ·  view source on GitHub ↗
(&mut self, element_id: &Id)

Source from the content-addressed store, hash-verified

1264 }
1265
1266 pub fn open_element_with_id(&mut self, element_id: &Id) {
1267 if self.boolean_warnings.max_elements_exceeded {
1268 return;
1269 }
1270 let mut elem = LayoutElement {
1271 text_data_index: -1,
1272 ..Default::default()
1273 };
1274 elem.id = element_id.id;
1275 self.layout_elements.push(elem);
1276 let idx = (self.layout_elements.len() - 1) as i32;
1277 self.open_layout_element_stack.push(idx);
1278
1279 while self.layout_element_clip_element_ids.len() < self.layout_elements.len() {
1280 self.layout_element_clip_element_ids.push(0);
1281 }
1282
1283 self.add_hash_map_item(element_id, idx);
1284 if self.debug_mode_enabled {
1285 self.layout_element_id_strings.push(element_id.string_id.clone());
1286 }
1287
1288 if !self.open_clip_element_stack.is_empty() {
1289 let clip_id = *self.open_clip_element_stack.last().unwrap();
1290 self.layout_element_clip_element_ids[idx as usize] = clip_id;
1291 } else {
1292 self.layout_element_clip_element_ids[idx as usize] = 0;
1293 }
1294 }
1295
1296 pub fn configure_open_element(&mut self, declaration: &ElementDeclaration<CustomElementData>) {
1297 if self.boolean_warnings.max_elements_exceeded {

Callers 5

childrenMethod · 0.80
begin_layoutMethod · 0.80
debug_open_idMethod · 0.80
debug_open_idiMethod · 0.80
render_debug_viewMethod · 0.80

Calls 3

add_hash_map_itemMethod · 0.80
cloneMethod · 0.80
is_emptyMethod · 0.80

Tested by

no test coverage detected