如何处理这种情况?我已经创建了一个新路径,但仍更改了以前的路径颜色和大小。
private lateinit var mPaint: Paint
private lateinit var mEraserPaint: Paint
private val mEraserPath: Path = Path()
private val mArrayPaths: ArrayList<Path> = ArrayList<Path>()
override fun onDraw(canvas: Canvas) {
Timber.d("ON DRAW")
for (path: Path in mArrayPaths) {
setPaintColor(getStrokeColor())
setPaintSize(getStrokeSize())
canvas.drawPath(path, mPaint)
}
canvas.drawPath(mEraserPath, mEraserPaint)
}