mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-07 16:52:47 +00:00
A blend's record in the editing data holds its Blend Options spacing. Word 1 is the spacing: 0 is Smooth Color, 1 is Specified Steps and 2 is Specified Distance. For Specified Distance, word 2 is the distance in points as a 32-bit float. The reader took only records whose word 1 is 1, so every Smooth Color and Specified Distance blend came in as its drawn steps. A Smooth Color or Specified Distance blend now opens live with that spacing where VectorCraft lays out as many steps between each pair of keys as the file draws, in the same places and colors. Otherwise it keeps its drawn steps with the existing note. The distance is read as the shortest decimal that reads back as the stored float. The steps are counted before anything is laid out, and a blend takes from the import's budget only when its count matches. Specified Steps blends are read as before, with the steps counted from the drawn ones. Tests: import::ai::tests::a_blend_keeps_its_spacing, a_blend_of_three_keys_keeps_its_distance_between_each_pair, a_blend_whose_spacing_doesnt_lay_out_its_steps_keeps_them, import::ai::blend::tests::records_say_their_spacing, a_blend_takes_from_the_budget_only_when_it_is_laid_out, a_distance_past_the_keys_lays_out_no_steps, and the fuzz case ai_blend_spacing_never_panics.