@@ -243,7 +243,8 @@ sxbp_status_t sxbp_resize_spiral(
243243 * index of the highest line to plot to and a pointer to a callback function,
244244 * calculate the length needed for each line in the spiral up to this index
245245 * (to avoid line overlap) and store these in a the spiral struct that is
246- * pointed to by the pointer
246+ * pointed to by the pointer. If the spiral has some lines already solved, the
247+ * algorithm will start at the next unsolved line.
247248 * the function pointer can be NULL, if it is not then it will be called every
248249 * time a new line of the spiral is solved. The function should be of return
249250 * type void and take three arguments: a pointer to a spiral_t struct, an
@@ -261,8 +262,8 @@ sxbp_status_t sxbp_plot_spiral(
261262 sxbp_status_t result = {{0 , 0 , 0 }, 0 };
262263 // get index of highest line to plot
263264 uint64_t max_index = (max_line > spiral -> size ) ? spiral -> size : max_line ;
264- // calculate the length of each line
265- for (size_t i = 0 ; i < max_index ; i ++ ) {
265+ // calculate the length of each line within range solved_count -> max_index
266+ for (size_t i = spiral -> solved_count ; i < max_index ; i ++ ) {
266267 result = sxbp_resize_spiral (spiral , i , 1 , perfection_threshold );
267268 // catch and return error if any
268269 if (result .diagnostic != SXBP_OPERATION_OK ) {
0 commit comments