title: draw arc in the center of the Canvas
body: <p>This is how I am drawing arc...</p>
  
  <p>First picture shows how currently it draws on canvas always LEFT TOP corner I want to darw
  it any of the corner of the canvas example second picture RIGHT|BOTTOM</p>
  
  <p><img src="https://i.stack.imgur.com/Du6VY.png" alt="Current">   <img src="https://i.stack.imgur.com/r9SLF.png" alt="what I want"></p>
  
  <pre><code>public void onDraw(Canvas canvas) {
  
      if(first == null)
          first = new RectF();
      if(second == null)
          second = new RectF();
  
      if(p == null)
          p = new Path();
      canvas.drawColor(Color.TRANSPARENT);
      paint.reset();
      paint.setAntiAlias(true);
      float _X, _Y, radius, innerRadius;
      path.reset();
  
      float currentAngle =90;
      float currentSweep;
      float padding = 0;
  
  
      _X = 150;//getWidth();
      _Y = 150;//getHeight();
  
      if (_X &lt; _Y) {
          radius = _X;
      } else {
          radius = _Y;
      }
      radius -= padding;
      innerRadius = radius - thickness;
  
      first.set(_X - radius, _Y - radius, _X + radius, _Y + radius);
      second.set(_X - innerRadius, _Y - innerRadius, _X + innerRadius, _Y + innerRadius);
  
      paint.setColor(Color.GREEN);
      currentSweep = 270;
  
      p.arcTo(first, currentAngle + padding, currentSweep - padding);
      p.arcTo(second, (currentAngle + padding) + (currentSweep - padding), -(currentSweep - padding));
  
      canvas.drawPath(p, paint);
      p.close();
  
  }
  </code></pre>
  
  <p>But it always draws in the LEFT TOP corner how can I change this to CENTER and any corner of canvas. I want a flexibility to change location of my arc anywhere in the Canvas. </p>
  
  <p>Please help.</p>