CS-foreach / creative-coding-p5js

Teaching creative coding in p5.js
https://cs-foreach.github.io/creative-coding-p5js/
MIT License
1 stars 1 forks source link

`animationStudio.js`: clear button doesn't remove drawings from stack #18

Open totally-not-frito-lays opened 6 months ago

totally-not-frito-lays commented 6 months ago

Steps to recreate

  1. draw something on the canvas
  2. hit c to clear the screen
  3. draw again
  4. hit space_bar to run the animation
  5. the drawings before and after clearing the screen are saved in the redraw stack

Expected behavior

  1. after clearing the screen, the saved stack should also be empty
phentos commented 6 months ago

The expected behavior described is already implemented as reset().

Currently clear() only affects the currently rendered canvas, but it's a good idea to add it to the timeline at that position (i.e., clearing during playback adds that to the timeline at that position).