Skip to content

Commit

Permalink
Erase functionality added
Browse files Browse the repository at this point in the history
  • Loading branch information
Miihir79 committed Jul 21, 2021
1 parent b97da60 commit b1be055
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ class drawingView(context: Context, attrs: AttributeSet) : View(context,attrs){
mDrawPaint!!.color = color
}

// you can pass a color according to your background and the default is white
fun erase(colorBackground: Int= Color.WHITE){
currentColor = colorBackground
mDrawPaint!!.color = colorBackground
}

fun undo(){
if (mPaths.size > 0){
mUndoPath.add(mPaths[mPaths.size -1])
Expand Down

0 comments on commit b1be055

Please sign in to comment.