-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Version: 0.9
Scenario: I have 2 svgs, one is the parent and has a child svg. Here is stripped down version below:
commands
.spawn(Svg3dBundle {
svg: component_svg,
origin: Origin::Center,
transform: Transform {
translation: translation,
scale: Vec3::new(1.0, 1.0, 1.0),
..Default::default()
},
..Default::default()
})
.with_children(|parent| {
parent.spawn(Svg3dBundle {
svg: pin_svg,
origin: Origin::Center,
transform: Transform {
translation: Vec3::new(pin.position.x, pin.position.y, 1.0),
scale: Vec3::new(1.0, 1.0, 1.0),
..Default::default()
},
..Default::default()
});
}The problems that I see are as follows:
- The placement of the child seems to follow
Origin::TopLeftof the child instead ofOrigin::Centerof the child - When the child is translated by itself, it is placed relative to the
Origin::TopLeftof the parent, andOrigin::Centerof the child.- When the parent is translated, the child is placed back according to the
Origin::TopLeftof the child, offset from the (correct)Origin::Centerof the parent.
- When the parent is translated, the child is placed back according to the
I'm not sure if it matters, but I'm using bevy-inspector-egui to modify the transforms. A short recording of the issues can be seen below:
bevy_svg_parenting_problems.webm
If a more minimal reproduction or repo with example would be useful, I can make one up.
cornytrace
Metadata
Metadata
Assignees
Labels
No labels