Code example for PointF

Methods: equals

0
		super(context);
	} 
 
	@Override 
	public boolean onTouchEvent(MotionEvent event) {
		PointF current = new PointF(event.getX(), event.getY());
		pline.setColor(Color.WHITE);
		if (!current.equals(last)) {
			points.add(current);
			presiones.add(event.getPressure());
			invalidate((int)Math.min(current.x, last.x)-7, (int)Math.min(current.y, last.y)-7,
					(int)Math.max(current.x, last.x)+7, (int)Math.max(current.y, last.y)+7);
			last = current;
		} 
		if (event.getAction()==MotionEvent.ACTION_UP) {
			points.add(new PointF(-1,-1));
			presiones.add(-1.0f);
			invalidate();
		} 
		return true; 
	}