Korilakkuma / CanvasView

Android Application Library
Other
183 stars 72 forks source link

Fixing erase mode #11

Open jackmiras opened 8 years ago

jackmiras commented 8 years ago

Hi @Korilakkuma I have fixed the problem with the erase mode by changing the way of how createPaint method handle with erase mode. As you will see on the code of the createPaint method, I have added a new fixed configuration where I set Paint.setColor(this.paintStrokeColor). Inside the if condition, instead of call Paint.setXfermode() and Paint.setARGB(), I'm calling Paint.setColor(canvasBackgroundColor). I also moved out all the code of the else condition so, in this way, if the user doesn't pick the erase mode ,the createPaint will return a Paint object with the same color of printStrokeColor.