rberman / Synesthesia

Ionic app that makes users' drawings into music
GNU General Public License v3.0
0 stars 0 forks source link

Undo button #17

Closed rberman closed 8 years ago

rberman commented 8 years ago

The undo button clears the entire canvas. It should only undo the most recent line drawn.

rberman commented 8 years ago

Maybe look at where cPushArray gets pushed.

rberman commented 8 years ago

Issue is caused by when a line drawn on the canvas is pushed to the cPushArray. This happens whenever the mouse button is released, but this is a problem because when we press undo, it resets to the previous canvas, which is the same as the current. We need to find some way to push the previous line to the array only after the next line is drawn.

rberman commented 8 years ago

I know think that I've fixed the issue, but if someone could please pull and test it and let me know if anything weird happens, that would be amazing.

mjaminbook commented 8 years ago

Ya, some weird stuff still happens for me. There was one thing that was weird where it wouldn't undo all the lines, but that only happened once. The other thing that happened was when I drew something, I hit delete and then drew another line. When I hit the undo button it brought up the picture I deleted, but I couldn't continue to undo. Plus the lines array was empty because I cleared the drawing.

rberman commented 8 years ago

I (think and hope I) fixed the bug that allowed undo to override trash. Thanks for pointing it out. Please keep testing. If you could describe the circumstances when it won't undo (how many lines are on the canvas, had you drawn before and undone, trashed, or returned to the home screen, had you pressed play and come back), that would help me a lot with debugging.

mjaminbook commented 8 years ago

Ya, I'll try to pay more attention to what the circumstances surrounding that bug are. But thanks for working on this so much!

On Tue, Apr 12, 2016 at 9:38 PM, Ruthie Berman notifications@github.com wrote:

I (think and hope I) fixed the bug that allowed undo to override trash. Thanks for pointing it out. Please keep testing. If you could describe the circumstances when it won't undo (how many lines are on the canvas, had you drawn before and undone, trashed, or returned to the home screen, had you pressed play and come back), that would help me a lot with debugging.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/rberman/Synesthesia/issues/17#issuecomment-209200209

rberman commented 8 years ago

The number of notes to subtract from the lines array isn't saved and remembered for each undo.