about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGenny <gen@nyble.dev>2022-09-18 17:57:51 -0500
committerGenny <gen@nyble.dev>2022-09-18 17:57:51 -0500
commitf0d6b6bf8675bf7e44dd4751abb69394f1f1559d (patch)
tree44bd2eb0eb3f520d1aec9a73fafe633789eee480
parenta06ac66e720acf17512127c4420da0abdcd2c6e0 (diff)
downloadgifed-f0d6b6bf8675bf7e44dd4751abb69394f1f1559d.tar.gz
gifed-f0d6b6bf8675bf7e44dd4751abb69394f1f1559d.zip
Set packed field correctly
-rw-r--r--gifed/src/block/packed.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/gifed/src/block/packed.rs b/gifed/src/block/packed.rs
index f091fb3..59da8c9 100644
--- a/gifed/src/block/packed.rs
+++ b/gifed/src/block/packed.rs
@@ -127,7 +127,7 @@ impl ImagePacked {
 	pub fn set_color_table_size(&mut self, size: u8) {
 		// The color table is the least significant already, don't do anything
 		// except select the bits
-		self.raw = size & 0b0_0_0_00_111;
+		self.raw |= size & 0b0_0_0_00_111;
 	}
 }
 
@@ -174,6 +174,6 @@ impl ScreenPacked {
 	}
 
 	pub fn set_color_table_size(&mut self, size: u8) {
-		self.raw = size & 0b0_0_0_00_111;
+		self.raw |= size & 0b0_0_0_00_111;
 	}
 }