Browse Source

More refactoring

Kevin Lee 1 year ago
parent
commit
baae23ff45
3 changed files with 13 additions and 11 deletions
  1. 1 11
      src/ezcad/file.rs
  2. 11 0
      src/ezcad/layer.rs
  3. 1 0
      src/ezcad/mod.rs

+ 1 - 11
src/ezcad/file.rs

@@ -1,6 +1,6 @@
 use binrw::{BinRead, BinWrite, FilePtr64};
 
-use crate::{pen::PenHeader, types::Rgba};
+use crate::{pen::PenHeader, types::Rgba, layer::LayerHeader};
 
 #[derive(BinRead, Debug)]
 pub struct Header {
@@ -25,13 +25,3 @@ pub struct Thumbnail {
     #[br(count = dimension_x * dimension_y)]
     pub pixels: Vec<Rgba>,
 }
-
-#[derive(BinRead, BinWrite, Debug)]
-pub struct LayerHeader {
-    pub layer_count: u32,
-    #[br(count = layer_count)]
-    pub layers: Vec<Layer>,
-}
-
-#[derive(BinRead, BinWrite, Debug)]
-pub struct Layer {}

+ 11 - 0
src/ezcad/layer.rs

@@ -0,0 +1,11 @@
+use binrw::{BinRead, BinWrite};
+
+#[derive(BinRead, BinWrite, Debug)]
+pub struct LayerHeader {
+    pub layer_count: u32,
+    #[br(count = layer_count)]
+    pub layers: Vec<Layer>,
+}
+
+#[derive(BinRead, BinWrite, Debug)]
+pub struct Layer {}

+ 1 - 0
src/ezcad/mod.rs

@@ -3,3 +3,4 @@ pub mod field_of;
 pub mod file;
 pub mod pen;
 pub mod types;
+pub mod layer;