default z for shapes is now 1
This commit is contained in:
parent
38261fbf54
commit
43221c02a7
1 changed files with 9 additions and 9 deletions
|
@ -31,10 +31,10 @@ pub fn create_sys(
|
|||
|
||||
// Update each point to be relative to the new center!
|
||||
if let Ok(mut t) = transforms.get_mut(sd.main_shape) {
|
||||
t.translation = center.extend(0.0);
|
||||
t.translation = center.extend(1.0);
|
||||
}
|
||||
if let Ok(mut t) = transforms.get_mut(sd.center.unwrap()) {
|
||||
t.translation = Vec3::new(0.0, 0.0, 0.5); // Just to make sure the center is centered
|
||||
t.translation = Vec3::new(0.0, 0.0, 1.5); // Just to make sure the center is centered
|
||||
}
|
||||
for edge in sd.edges.iter() {
|
||||
if let Ok(mut t) = transforms.get_mut(*edge) {
|
||||
|
@ -44,7 +44,7 @@ pub fn create_sys(
|
|||
// If we dont have a transform in the query for the relevant entity,
|
||||
// then it should be the entity we just inserted, and we can just override its transform
|
||||
coms.entity(*edge)
|
||||
.insert(Transform::from_translation((mouse_pos - center).extend(0.5)));
|
||||
.insert(Transform::from_translation((mouse_pos - center).extend(1.5)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ fn add_center_point(
|
|||
let np = coms.spawn_bundle(GeometryBuilder::build_as(
|
||||
&shape,
|
||||
DrawMode::Fill(FillMode::color(Color::RED)),
|
||||
Transform::from_translation(Vec3::new(0.0, 0.0, 0.5))
|
||||
Transform::from_translation(Vec3::new(0.0, 0.0, 1.5))
|
||||
))
|
||||
.insert(Visibility { is_visible: false })
|
||||
.id();
|
||||
|
@ -188,7 +188,7 @@ fn insert_edge_to_shape_creation(
|
|||
let np = coms.spawn_bundle(GeometryBuilder::build_as(
|
||||
&shape,
|
||||
DrawMode::Fill(FillMode::color(Color::RED)),
|
||||
Transform::from_translation(mpos.extend(0.5))
|
||||
Transform::from_translation(mpos.extend(1.5))
|
||||
))
|
||||
.id();
|
||||
|
||||
|
@ -290,7 +290,7 @@ fn create_new_shape(coms: &mut Commands, pos: Vec2, create_shape: CreateShape, p
|
|||
let fp = coms.spawn_bundle(GeometryBuilder::build_as(
|
||||
&shape,
|
||||
DrawMode::Fill(FillMode::color(Color::RED)),
|
||||
Transform::from_translation(pos.extend(0.5))
|
||||
Transform::from_translation(pos.extend(1.5))
|
||||
))
|
||||
.id();
|
||||
// Spawn main shape!
|
||||
|
@ -300,7 +300,7 @@ fn create_new_shape(coms: &mut Commands, pos: Vec2, create_shape: CreateShape, p
|
|||
coms.spawn_bundle(GeometryBuilder::build_as(
|
||||
&shape,
|
||||
draw_mode,
|
||||
Transform::from_translation(Vec3::ZERO)
|
||||
Transform::from_translation(Vec3::Z)
|
||||
)).id()
|
||||
},
|
||||
CreateShape::Square => {
|
||||
|
@ -308,7 +308,7 @@ fn create_new_shape(coms: &mut Commands, pos: Vec2, create_shape: CreateShape, p
|
|||
coms.spawn_bundle(GeometryBuilder::build_as(
|
||||
&shape,
|
||||
draw_mode,
|
||||
Transform::from_translation(Vec3::ZERO)
|
||||
Transform::from_translation(Vec3::Z)
|
||||
)).id()
|
||||
},
|
||||
CreateShape::Circle => {
|
||||
|
@ -316,7 +316,7 @@ fn create_new_shape(coms: &mut Commands, pos: Vec2, create_shape: CreateShape, p
|
|||
coms.spawn_bundle(GeometryBuilder::build_as(
|
||||
&shape,
|
||||
draw_mode,
|
||||
Transform::from_translation(Vec3::ZERO)
|
||||
Transform::from_translation(Vec3::Z)
|
||||
)).id()
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue