Skip to content

Commit 5b3be7c

Browse files
committed
Make params mandatory
1 parent 5776ddc commit 5b3be7c

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
@@ -395,7 +395,7 @@ fn extract_sdf_shaders(
395395
#[derive(Component, Clone, Debug)]
396396
struct ExtractedShape {
397397
color: Color,
398-
params: Option<Vec4>,
398+
params: Vec4,
399399
frame: f32,
400400
sdf_shader: Handle<Shader>, // todo could be HandleId?
401401
fill_shader: Handle<Shader>, // todo could be HandleId?
@@ -552,7 +552,7 @@ fn queue_shapes(
552552
// | ((color[3] * 255.0) as u32) << 24;
553553

554554
let color = extracted_shape.color.as_linear_rgba_f32();
555-
let params = extracted_shape.params.unwrap_or_default().to_array();
555+
let params = extracted_shape.params.to_array();
556556

557557
let position = extracted_shape.transform.translation;
558558
let z = position.z;

src/ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ fn prepare_ui_shapes(
192192
}
193193

194194
let color = extracted_shape.color.as_linear_rgba_f32();
195-
let params = extracted_shape.params.unwrap_or_default().to_array();
195+
let params = extracted_shape.params.to_array();
196196

197197
let position = position.into();
198198
// let position = Vec3::ZERO.into();

0 commit comments

Comments
 (0)