parser refactoring

This commit is contained in:
Aleksander
2025-06-28 17:39:53 +02:00
parent 247c51c3b7
commit 2420e8007c
12 changed files with 252 additions and 219 deletions
+2 -4
View File
@@ -1,8 +1,7 @@
use crate::{
layout::WidgetID,
parser::{
ParserContext, ParserFile, iter_attribs, parse_children, parse_universal,
style::style_from_node,
ParserContext, ParserFile, iter_attribs, parse_children, parse_universal, style::parse_style,
},
renderer_vk::text::custom_glyph::{CustomGlyphContent, CustomGlyphData},
widget::sprite::{SpriteBox, SpriteBoxParams},
@@ -18,6 +17,7 @@ pub fn parse_widget_sprite<'a>(
) -> anyhow::Result<()> {
let mut params = SpriteBoxParams::default();
let attribs: Vec<_> = iter_attribs(file, ctx, &node, false).collect();
let style = parse_style(&attribs);
let mut glyph = None;
for (key, value) in attribs {
@@ -53,8 +53,6 @@ pub fn parse_widget_sprite<'a>(
log::warn!("No source for sprite node!");
};
let style = style_from_node(file, ctx, node);
let (new_id, _) = ctx
.layout
.add_child(parent_id, SpriteBox::create(params)?, style)?;