Android实现刮奖的效果(3)

private void touchMove(float x, float y) {
  float dx = Math.abs(x - mX);
  float dy = Math.abs(y - mY);
  if (dx >= TOUCH_TOLERANCE || dy >= TOUCH_TOLERANCE) {
   mPath.quadTo(mX, mY, (x + mX) / 2, (y + mY) / 2);
   mX = x;
   mY = y;
  }

}

private void touchUp(float x, float y) {
  mPath.lineTo(x, y);
  mCanvas.drawPath(mPath, mPaint);
  mPath.reset();
 }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/303ef0ae3d20ab5a4da3697bb7617505.html