diff --git a/canvas.py b/canvas.py index 9ade050..ab95cfd 100644 --- a/canvas.py +++ b/canvas.py @@ -85,13 +85,14 @@ class EditorCanvas(tkinter.Canvas): bit_counter=0 current_value=0 for pixel in self.current_char_pixels: - current_value|=pixel if bit_counter==8: packed_data.append(current_value) bit_counter=0 current_value=0 - current_value<<=1 + current_value|=(pixel<<(7-bit_counter)) bit_counter+=1 + if bit_counter>1: + packed_data.append(current_value) self.project.chars[chr(self.current_char)]=base64.b64encode(bytes(packed_data)).decode("ascii")