diff --git a/examples/svg.rs b/examples/svg.rs index 6416404dc3743679d5d748957bde42012c74c25c..480c558b8dd5d90557b21896cd8aa5c8695e670c 100644 --- a/examples/svg.rs +++ b/examples/svg.rs @@ -20,17 +20,23 @@ fn startup( let parent_id = None; rsx! { <KayakAppBundle> - <KSvgBundle - svg={KSvg(svg)} + <ElementBundle styles={KStyle { position_type: StyleProp::Value(KPositionType::SelfDirected), - left: StyleProp::Value(Units::Pixels(10.0)), - top: StyleProp::Value(Units::Pixels(10.0)), - width: StyleProp::Value(Units::Pixels(800.0)), - height: StyleProp::Value(Units::Pixels(800.0)), + left: StyleProp::Value(Units::Pixels(-34.545261 * 7.6)), + top: StyleProp::Value(Units::Pixels(10.0 - 95.557219 * 7.6)), ..Default::default() }} - /> + > + <KSvgBundle + svg={KSvg(svg)} + styles={KStyle { + width: StyleProp::Value(Units::Pixels(800.0)), + height: StyleProp::Value(Units::Pixels(800.0)), + ..Default::default() + }} + /> + </ElementBundle> </KayakAppBundle> }; diff --git a/src/render/unified/pipeline.rs b/src/render/unified/pipeline.rs index 1f929da115cee549ac98ac45421da4905f4232ee..e0945b334710b91d4489ce49c2e089fa4d0e67e4 100644 --- a/src/render/unified/pipeline.rs +++ b/src/render/unified/pipeline.rs @@ -951,8 +951,8 @@ pub fn queue_quads_inner( color, uv: [0.0; 4], pos_size: [ - sprite_rect.min.x, - sprite_rect.min.y, + 0.0, + 0.0, sprite_rect.size().x, sprite_rect.size().y, ],