evhan55 / ploma

Ploma: High-fidelity ballpoint pen rendering for pressure sensitive tablets
http://plomaproject.tumblr.com
98 stars 10 forks source link

textureSampleStep is not reset on clear #8

Open athomschke opened 8 years ago

athomschke commented 8 years ago

When calling clear on a Ploma instance, textureSampleStep is not reset.

I am using Ploma in a way where randomization is not desired: I want to plug undo and redo onto it. There it is essential that the sequence "undo redo" restores the initial image. I can achieve that by simply overwriting Math.random with a function that returns an arbitrary chosen value. One could see this value as a representation of the unique structure of paper. However, since textureSampleStep is not being reset, the result after undoing and redoing is still distinct if I don't use a completely new Ploma instance.

In my opinion, textureSampleStep should be reset to 0 in this.clear routine.

evhan55 commented 8 years ago

Oh! This makes sense to me, I think! Thank you very much for finding it and pointing it out. Would you like to submit a PR?

athomschke commented 8 years ago

Done