@@ -146,23 +146,23 @@ void Canvas::addImage(int16_t x, int16_t y, MarlinImage image, uint16_t *colors)
146146 dsty = y, dstx = x; // Destination line / column index
147147
148148 uint16_t color = 0 ; // Persist the last fetched color value
149- if (rle_state.has_rle_state ) { // do we have rle position data
149+ if (rle_state.has_rle_state ) { // do we have RLE position data?
150+ rle_state.has_rle_state = false ; // invalidate stored RLE state
150151 dstx = rle_state.dstx ; // restore required states
151152 dsty = rle_state.dsty ;
152153 srcx = rle_state.srcx ;
153154 srcy = rle_state.srcy ;
154155 bytedata = (uint8_t *)images[image].data + rle_state.rle_offset ; // restart decode from here instead of the start of data
155- rle_state.has_rle_state = false ; // invalidate stored rle state
156156 }
157157
158158 bool done = false ;
159159 while (!done) {
160160 if (dsty >= endLine -1 || srcy >= image_height -1 ) { // Store state?
161- rle_state.dstx = dstx; // save required states
161+ rle_state.dstx = dstx; // Save required states
162162 rle_state.dsty = dsty;
163163 rle_state.srcx = srcx;
164164 rle_state.srcy = srcy;
165- rle_state.rle_offset = bytedata - (uint8_t *)images[image].data ;; // Keep these for skipping full rle decode on future iteratons
165+ rle_state.rle_offset = bytedata - (uint8_t *)images[image].data ;; // Keep these for skipping full RLE decode on future iteratons
166166 }
167167
168168 uint8_t count = *bytedata++; // Get the count byte
@@ -193,7 +193,7 @@ void Canvas::addImage(int16_t x, int16_t y, MarlinImage image, uint16_t *colors)
193193 srcx = 0 ; dstx = x; // May be shifted within the canvas, but usually not
194194 if (dsty >= endLine || srcy >= image_height) { // Done with the segment or the image?
195195 done = true ; // Set a flag to end the loop...
196- rle_state.has_rle_state = true ; // rle state is stored
196+ rle_state.has_rle_state = true ; // RLE state is stored
197197 break ; // ...and break out of while(count--)
198198 }
199199 }
0 commit comments