Fix char data encoding

This commit is contained in:
mrkubax10 2024-03-03 17:06:37 +01:00
parent 164b71a0c3
commit 4b9ff9e035

View File

@ -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")