Android FingerPaint sample does not draw dot?

前端 未结 4 1671
梦如初夏
梦如初夏 2020-12-06 13:50

Fingerpaint example in sample android api demo does not draw dot/point by touching finger on screen. In code they have used Path to draw line, is there any way to draw circl

4条回答
  •  醉酒成梦
    2020-12-06 14:01

    If you'd rather continue to use your path, store your ACTION_DOWN coordinates and compare them in ACTION_UP. If they haven't moved, add a tiny circle to your path.

    path.addCircle(event.getX(), event.getY(), paint.getStrokeWidth()/4f, Path.Direction.CW);
    

    The advantage of this approach is that it is simple and the circle does not look at all out of place.

提交回复
热议问题