From f0d6b6bf8675bf7e44dd4751abb69394f1f1559d Mon Sep 17 00:00:00 2001 From: Genny Date: Sun, 18 Sep 2022 17:57:51 -0500 Subject: Set packed field correctly --- gifed/src/block/packed.rs | 4 ++-- 1 file 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; } } -- cgit 1.4.1-3-g733a5