Path rewind - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Path rewind method.

This code example shows how to use the following methods:close, lineTo, moveTo, rewind
    @Override 
    protected void onDraw(final Canvas canvas) {
        super.onDraw(canvas);
        final int xPos = (int)(getWidth() * mXRatio);
        final int height = getHeight();
        mIndicatorPath.rewind();
        mIndicatorPath.moveTo(xPos, 0);
        mIndicatorPath.lineTo(xPos + height, height);
        mIndicatorPath.lineTo(xPos - height, height);
        mIndicatorPath.close();
        canvas.drawPath(mIndicatorPath, mIndicatorPaint);
    } 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:lineTo, moveTo, rewind
 
	@Override 
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
 
		mPath.rewind();
		mPath.moveTo(0, mHeight / 2);
		mPath.lineTo(mWidth / 2, 0);
		mPath.lineTo(mWidth, mHeight / 2);
		mPath.lineTo(mWidth * 3 / 4, mHeight / 2);
		mPath.lineTo(mWidth * 3 / 4, mHeight);
		mPath.lineTo(mWidth / 4, mHeight);
		mPath.lineTo(mWidth / 4, mHeight / 2);
		mPath.lineTo(0, mHeight / 2);
 
		canvas.drawPath(mPath, mPaint);
	} 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:arcTo, close, lineTo, moveTo, rewind
        w.arc2.inset(-w.r2, -w.r2);
        return true; 
    } 
 
    private static void createPath(final Path path, final WorkingSet w) {
        path.rewind();
        // Trail cap at P1. 
        path.moveTo(w.p1x, w.p1y);
        path.arcTo(w.arc1, w.aa, w.a1);
        // Trail cap at P2. 
        path.moveTo(w.p2x, w.p2y);
        path.arcTo(w.arc2, w.aa, w.a2);
        // Two trapezoids connecting P1 and P2. 
        path.moveTo(w.p1ax, w.p1ay);
        path.lineTo(w.p1x, w.p1y);
        path.lineTo(w.p1bx, w.p1by);
        path.lineTo(w.p2bx, w.p2by);
        path.lineTo(w.p2x, w.p2y);
        path.lineTo(w.p2ax, w.p2ay);
        path.close();

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addPath, lineTo, rewind
        else 
        { 
            final float x = nsecWidth * relTime;
            pathStroke.lineTo(x, (float) (height * (1 - value)));
             
            pathFill.rewind();
            pathFill.addPath(pathStroke);
            pathFill.lineTo(x, height);
            pathFill.lineTo(0, height);
        } 
    } 
     
    public void draw(final Canvas canvas)
    { 
        canvas.drawPath(pathStroke, paintStroke);
        canvas.drawPath(pathFill, paintFill);
    } 
     
    public void reset() 
    { 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:arcTo, close, lineTo, moveTo, rewind
        mArc1.set(p1x, p1y, p1x, p1y);
        mArc1.inset(-r1, -r1);
        mArc2.set(p2x, p2y, p2x, p2y);
        mArc2.inset(-r2, -r2);
 
        mPath.rewind();
        // Trail cap at P1. 
        mPath.moveTo(p1x, p1y);
        mPath.arcTo(mArc1, angle, a1);
        // Trail cap at P2. 
        mPath.moveTo(p2x, p2y);
        mPath.arcTo(mArc2, angle, a2);
        // Two trapezoids connecting P1 and P2. 
        mPath.moveTo(p1ax, p1ay);
        mPath.lineTo(p1x, p1y);
        mPath.lineTo(p1bx, p1by);
        mPath.lineTo(p2bx, p2by);
        mPath.lineTo(p2x, p2y);
        mPath.lineTo(p2ax, p2ay);
        mPath.close();

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:close, lineTo, moveTo, rewind
    @Override 
    protected void onDraw(final Canvas canvas) {
        super.onDraw(canvas);
        final int xPos = (int)(getWidth() * mXRatio);
        final int height = getHeight();
        mIndicatorPath.rewind();
        mIndicatorPath.moveTo(xPos, 0);
        mIndicatorPath.lineTo(xPos + height, height);
        mIndicatorPath.lineTo(xPos - height, height);
        mIndicatorPath.close();
        canvas.drawPath(mIndicatorPath, mIndicatorPaint);
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:lineTo, moveTo, rewind
This code example shows how to use the following methods:quadTo, rewind
      onTouchDown( x, y );
    } 
  } 
 
  private void drawQuadTo( float curX, float curY, float controlPointX, float controlPointY ) {
    linePath.quadTo( controlPointX, controlPointY, curX, curY );
    drawPath(); 
    invalidateDrawingRegion( curX, curY );
    lastX = curX;
    lastY = curY;
  } 
 
  private void onTouchUpOrCancel( float x, float y ) {
    drawQuadTo( x, y, x, y );
    sendPolylineRequest(); 
    linePath.rewind();
    recordedCoords.clear();
  } 
 
  private void record( float x, float y ) {

5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:moveTo, rewind
	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();
	} 
} 

5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:isEmpty, rewind
		int phraseMarkStart = SelectionUtils.getPhraseMarkStart(spannableText);
		int phraseMarkEnd = SelectionUtils.getPhraseMarkEnd(spannableText);
 
		if (SelectionUtils.hasPhraseMark(spannableText)) {
			getLayout().getSelectionPath(phraseMarkStart, phraseMarkEnd, phraseMarkPath);
		} else if (!phraseMarkPath.isEmpty()) {
			phraseMarkPath.rewind();
		} 
 
		canvas.drawPath(phraseMarkPath, phraseMarkPaint);
	} 
 
	public void markSelectionAsCardTitle() { 
		SelectionUtils.removePhraseMark((Spannable) getText());
		invalidate(); // removes the previous mark from the text view
		SelectionUtils.setSelectionAsPhrase((Spannable) getText());
		removeSelectionWithHandles(); 
	} 
 
	@Override 
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Path rewind Questions & Answers:

rewind Method Overview
Rewinds the path: clears any lines and curves from the path but keeps the internal data structure for faster reuse.
See Code Examples for other Android Path Methods: