Code example for Path

Methods: moveTorewind

0
	public void draw(Canvas canvas, MapView mapv, boolean shadow) {
		super.draw(canvas, mapv, shadow);
 
		Projection projection = mapv.getProjection();
		projection.toPixels(mGeoPoints.get(0), mPoint1);
		mPath.moveTo(mPoint1.x, mPoint1.y);
 
		for (int i = 1; i < mGeoPoints.size(); i++) {
			projection.toPixels(mGeoPoints.get(i), mPoint2);
			mPath.lineTo(mPoint2.x, mPoint2.y); // TODO improve drawing
			// mPoint1.x = (mPoint1.x + mPoint2.x) / 2; 
			// mPoint1.x = (mPoint1.y + mPoint2.y) / 2; 
			// mPath.quadTo(mPoint1.x, mPoint1.y, mPoint2.x, mPoint2.y); 
			// projection.toPixels(mGeoPoints.get(i), mPoint1); 
		} 
 
		canvas.drawPath(mPath, mPaint);
		mPath.rewind();
	} 
} 
Experience pair programming with AI  Get Codota for Java