Skip to content

Commit 2946b97

Browse files
committed
Make params mandatory
1 parent d6d9377 commit 2946b97

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

examples/params.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn setup(
7777
color,
7878
sdf: box_sdf.clone(),
7979
frame: Frame::Quad(f32::max(size.x, size.y) + padding),
80-
params: Some(Vec4::new(size.x, size.y, 0., 0.)),
80+
params: Vec4::new(size.x, size.y, 0., 0.),
8181
..Default::default()
8282
},
8383
..Default::default()

src/components.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub struct SmudShape {
2424
/// Parameters to pass to shapes, for things such as width of a box
2525
// perhaps it would be a better idea to have this as a separate component?
2626
// keeping it here for now...
27-
pub params: Option<Vec4>,
27+
pub params: Vec4,
2828
}
2929

3030
impl Default for SmudShape {

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ var<uniform> time: Time;
441441
#[derive(Component, Clone, Debug)]
442442
struct ExtractedShape {
443443
color: Color,
444-
params: Option<Vec4>,
444+
params: Vec4,
445445
frame: f32,
446446
sdf_shader: Handle<Shader>, // todo could be HandleId?
447447
fill_shader: Handle<Shader>, // todo could be HandleId?
@@ -594,7 +594,7 @@ fn queue_shapes(
594594
// | ((color[3] * 255.0) as u32) << 24;
595595

596596
let color = extracted_shape.color.as_linear_rgba_f32();
597-
let params = extracted_shape.params.unwrap_or_default().to_array();
597+
let params = extracted_shape.params.to_array();
598598

599599
let position = extracted_shape.transform.translation();
600600
let z = position.z;

src/ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ fn prepare_ui_shapes(
196196
}
197197

198198
let color = extracted_shape.color.as_linear_rgba_f32();
199-
let params = extracted_shape.params.unwrap_or_default().to_array();
199+
let params = extracted_shape.params.to_array();
200200

201201
let position = position.into();
202202
// let position = Vec3::ZERO.into();

0 commit comments

Comments
 (0)