Skip to content

Commit

Permalink
Merge pull request #44 from marceline-cramer/reflect-components
Browse files Browse the repository at this point in the history
Derive Reflect for all public components
  • Loading branch information
james-j-obrien authored Sep 2, 2024
2 parents 4c6eb42 + 5df8db0 commit 2ea2e5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/painter/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub fn update_canvases(
}

/// Enum that determines when canvases are cleared and redrawn.
#[derive(Default)]
#[derive(Default, Reflect)]
pub enum CanvasMode {
/// Always clear and draw each frame
#[default]
Expand All @@ -61,7 +61,7 @@ pub enum CanvasMode {
/// Component containing data and methods for a given canvas.
///
/// Can be spawned as part of a [`CanvasBundle`] with [`CanvasCommands::spawn_canvas`].
#[derive(Component)]
#[derive(Component, Reflect)]
pub struct Canvas {
/// Handle to the canvas' target texture.
pub image: Handle<Image>,
Expand Down
10 changes: 5 additions & 5 deletions src/shapes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod triangle;
pub use triangle::*;

/// Component that holds data related to a shape to be used during rendering,
#[derive(Component, Clone)]
#[derive(Component, Clone, Reflect)]
pub struct ShapeMaterial {
/// Alpha mode to use when rendering, Blend, Add and Multiply are explicitly supported.
pub alpha_mode: ShapeAlphaMode,
Expand Down Expand Up @@ -64,7 +64,7 @@ impl From<AlphaMode> for ShapeAlphaMode {
}

/// Used in [`ShapeFill`] to determine how a shape is rendered.
#[derive(Default, Clone, Copy)]
#[derive(Default, Clone, Copy, Reflect)]
pub enum FillType {
/// Fully colored shape
#[default]
Expand All @@ -76,7 +76,7 @@ pub enum FillType {
}

/// Component attached to each shape to determine how it is rendered.
#[derive(Default, Component, Clone, Copy)]
#[derive(Default, Component, Clone, Copy, Reflect)]
pub struct ShapeFill {
pub color: Color,
pub ty: FillType,
Expand All @@ -96,13 +96,13 @@ impl ShapeFill {
}

/// Marker component for entities that should be drawn by the 3D pipeline.
#[derive(Component)]
#[derive(Component, Default, Reflect)]
pub struct Shape3d;

/// Overrides the origin of a 3D shape so that transparent drawing order can be overridden.
///
/// This is in local space.
#[derive(Component)]
#[derive(Component, Reflect)]
pub struct ShapeOrigin(pub Vec3);

/// Bundle that is required to render a shape.
Expand Down

0 comments on commit 2ea2e5b

Please sign in to comment.