diff --git a/mangades/demo/large/bx117324-97mHyfJGwpBq.jpg b/mangades/demo/large/bx117324-97mHyfJGwpBq.jpg new file mode 100644 index 0000000..91b0fd3 Binary files /dev/null and b/mangades/demo/large/bx117324-97mHyfJGwpBq.jpg differ diff --git a/mangades/src/component_demo_syntax.rs b/mangades/src/component_demo_syntax.rs index 44f1f78..260fca3 100644 --- a/mangades/src/component_demo_syntax.rs +++ b/mangades/src/component_demo_syntax.rs @@ -1,6 +1,6 @@ use rusalka_macro::make_component; use std::default::Default; -use mangui::{SharedNode, nodes::Style, taffy::prelude::Size, femtovg::{Paint, Color}, nodes::layout::Layout}; +use mangui::{femtovg::ImageFlags, nodes::{layout::Layout, Style}, nodes::image::Image, taffy::prelude::Size}; use rusalka::nodes::primitives::{Rectangle, RectangleAttributes, PartialRectangleAttributes}; @@ -8,6 +8,10 @@ make_component!( ComponentDemo, MainLogic { let _radius = attrs.radius; + let imgpath = std::path::PathBuf::from("./demo/large/bx117324-97mHyfJGwpBq.jpg"); + let imgflags = ImageFlags::empty(); + let width = 230.; + let height = 325.; } Attributes { radius: f32 @@ -24,6 +28,24 @@ make_component!( radius: if $test_ { attrs.radius } else { 0. }, ..Default::default() } + @image { + style: Style { + layout: mangui::nodes::TaffyStyle { + min_size: Size { + width: mangui::taffy::style::Dimension::Points(width), + height: mangui::taffy::style::Dimension::Points(height) + }, + ..Default::default() + }, + ..Default::default() + }, + image: mangui::nodes::image::ImageLoad::LoadFile(imgpath, imgflags), + width, + height, + radius: 5., + events: Default::default(), + parent: None + } $|event| { match event.event { mangui::events::InnerEvent::MouseDown(_) => {