Skip to content

Commit

Permalink
fix(defaults): allow some fields to be optional, since they are not a…
Browse files Browse the repository at this point in the history
…lways included
  • Loading branch information
tversteeg committed Apr 6, 2024
1 parent a324782 commit 3b91332
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ serde_json = "1.0"

[dev-dependencies]
aseprite-test-data = "0.1.0"
png = "0.16.7"
png = "0.16.8"
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ pub struct Layer {
#[serde(default)] // 0 / missing for groups - editor shows "0" greyed out
pub opacity: u32,
// 0 / missing for groups - editor shows "Normal" greyed out
#[serde(default)]
pub blend_mode: BlendMode,
pub color: Option<Color>,
pub data: Option<String>,
Expand Down Expand Up @@ -242,6 +243,7 @@ pub struct Metadata {
pub format: String,
pub size: Dimensions,
pub scale: String, // Surely this should be a number?
#[serde(default)]
pub frame_tags: Vec<Frametag>,
#[serde(default)]
pub layers: Vec<Layer>,
Expand Down

0 comments on commit 3b91332

Please sign in to comment.