Specify radius for the corners of the rectangle. If this is > 0, then the
drawable is drawn in a round-rectangle, rather than a rectangle.
@param radius the radius for the corners of the rectangle
506573
@Override
  public void setRadius(float radius) {
    Preconditions.checkState(radius >= 0);
    Arrays.fill(mCornerRadii, radius);
    mRadiiNonZero = (radius != 0);
    mIsPathDirty = true;
    invalidateSelf();
  }
565107
public function roundCorners($radius = 5, $bgColor = 'transparent')
		# Author:     Jarrod Oberto
		# Date:       19-05-2011
		# Purpose:    Create rounded corners on your image
		# Param in:   (int) radius = the amount of curvature
		#       (mixed) $bgColor = the corner background color
		# Param out:  n/a
		# Reference:
		# Notes:
		#
	{

		// *** Check if the user wants transparency
		$isTransparent = false;
		if ( ! is_array($bgColor))
		{
			if (fix_strtolower($bgColor) == 'transparent')
			{
				$isTransparent = true;
			}
		}


		// *** If we use transparency, we need to color our curved mask with a unique color
		if ($isTransparent)
		{
			$bgColor = $this->findUnusedGreen();
		}

		// *** Convert color
		$rgbArray = $this->formatColor($bgColor);
		$r = $rgbArray['r'];
		$g = $rgbArray['g'];
		$b = $rgbArray['b'];
		if (isset($rgbArray['a']))
		{
			$a = $rgbArray['a'];
		}


		// *** Create top-left corner mask (square)
		$cornerImg = imagecreatetruecolor($radius, $radius);
		//$cornerImg = imagecreate($radius, $radius);

		//imagealphablending($cornerImg, true);
		//imagesavealpha($cornerImg, true);

		//imagealphablending($this->imageResized, false);
		//imagesavealpha($this->imageResized, true);

		// *** Give it a color
		$maskColor = imagecolorallocate($cornerImg, 0, 0, 0);


		// *** Replace the mask color (black) to transparent
		imagecolortransparent($cornerImg, $maskColor);


		// *** Create the image background color
		$imagebgColor = imagecolorallocate($cornerImg, $r, $g, $b);


		// *** Fill the corner area to the user defined color
		imagefill($cornerImg, 0, 0, $imagebgColor);


		imagefilledellipse($cornerImg, $radius, $radius, $radius * 2, $radius * 2, $maskColor);


		// *** Map to top left corner
		imagecopymerge($this->imageResized, $cornerImg, 0, 0, 0, 0, $radius, $radius, 100); #tl

		// *** Map rounded corner to other corners by rotating and applying the mask
		$cornerImg = imagerotate($cornerImg, 90, 0);
		imagecopymerge($this->imageResized, $cornerImg, 0, $this->height - $radius, 0, 0, $radius, $radius, 100); #bl

		$cornerImg = imagerotate($cornerImg, 90, 0);
		imagecopymerge($this->imageResized, $cornerImg, $this->width - $radius, $this->height - $radius, 0, 0, $radius, $radius, 100); #br

		$cornerImg = imagerotate($cornerImg, 90, 0);
		imagecopymerge($this->imageResized, $cornerImg, $this->width - $radius, 0, 0, 0, $radius, $radius, 100); #tr


		// *** If corners are to be transparent, we fill our chromakey color as transparent.
		if ($isTransparent)
		{
			//imagecolortransparent($this->imageResized, $imagebgColor);
			$this->imageResized = $this->transparentImage($this->imageResized);
			imagesavealpha($this->imageResized, true);
		}

	}
138700
function drawRadialNumbers(context, options) {
    let radius = radialTicksRadius(context, options) - context.max * 0.15;
    let points = {};
    let i = 0;
    let s = options.majorTicks.length;
    let isAnimated = options.animationTarget !== 'needle';
    let colors = options.colorNumbers instanceof Array ?
        options.colorNumbers : new Array(s).fill(options.colorNumbers);

    let plateValueAngle = isAnimated ? -(options.value - options.minValue) /
        (options.maxValue - options.minValue) * options.ticksAngle : 0;

    if (isAnimated) {
        context.save();
        context.rotate(-drawings.radians(plateValueAngle));
    }

    context.font = drawings.font(options, 'Numbers', context.max / 200);
    context.lineWidth = 0;
    context.textAlign = 'center';
    context.textBaseline = 'middle';

    for (; i < s; ++i) {
        let angle = plateValueAngle + radialNextAngle(options,
            options.exactTicks ? options.majorTicks[i] : i, s);
        let textWidth = context.measureText(options.majorTicks[i]).width;
        let textHeight = options.fontNumbersSize;
        let textRadius = Math.sqrt(textWidth * textWidth +
            textHeight * textHeight) / 2;
        let point = drawings.radialPoint(radius - textRadius -
            options.numbersMargin / 100 * context.max,
            drawings.radians(angle));

        if (angle === 360) angle = 0;

        if (points[angle]) {
            continue; //already drawn at this place, skipping
        }

        points[angle] = true;

        context.fillStyle = colors[i];
        context.fillText(options.majorTicks[i], point.x, point.y);
    }

    isAnimated && context.restore();
}
183311
@Override
	public void set(double x, double y, double z, double radius1) {
		this.cx = x;
		this.cy = y;
		this.cz = z;
		this.radius = Math.abs(radius1);
	}
925150
public void setProgressStyle(int style) {
        LoadingDrawable drawable = null;
        if (style == STYLE_CIRCLE) {
            Resources resources = getResources();
            drawable = new LoadingCircleDrawable(resources.getDimensionPixelOffset(R.dimen.g_loading_minSize),
                    resources.getDimensionPixelOffset(R.dimen.g_loading_maxSize));
        } else if (style == STYLE_LINE) {
            drawable = new LoadingLineDrawable();
        }
        setLoadingDrawable(drawable);
    }
464467
protected void stroke(ZoomableGraphicsContext gc, T element) {
		final double radius = element.getRadius();
		final double diameter = radius * radius;
		final double minx = element.getX() - radius;
		final double miny = element.getY() - radius;
		gc.strokeOval(minx, miny, diameter, diameter);
	}
1301685
public static void setDrawableProperties(
      @Nullable Drawable drawable, @Nullable DrawableProperties properties) {
    if (drawable == null || properties == null) {
      return;
    }
    properties.applyTo(drawable);
  }
507109
public void setRadiusProperty(DoubleProperty radius1) {
		this.radiusProperty = radius1;
		this.radiusProperty.set(Math.abs(this.radiusProperty.get()));
	}
421237
public void setInscribedRadius(double radius) {
		double side = getSideLengthFromInscribedRadius(radius, n);
		this.circumscribedRadius = getCircumscribedRadiusFromSideLength(side, n);
	}
668834
public static void drawCircle(Graphics g, int centerX, int centerY, int diameter){
		g.drawOval((int) (centerX-diameter/2), (int) (centerY-diameter/2), diameter, diameter);
	}
422871
public static Bitmap drawShadow(Bitmap map, int radius) {
        if (map == null)
            return null;

        BlurMaskFilter blurFilter = new BlurMaskFilter(radius, BlurMaskFilter.Blur.OUTER);
        Paint shadowPaint = new Paint();
        shadowPaint.setMaskFilter(blurFilter);

        int[] offsetXY = new int[2];
        Bitmap shadowImage = map.extractAlpha(shadowPaint, offsetXY);
        shadowImage = shadowImage.copy(Config.ARGB_8888, true);
        Canvas c = new Canvas(shadowImage);
        c.drawBitmap(map, -offsetXY[0], -offsetXY[1], null);
        return shadowImage;
    }
1264896
public static void drawRoundedCorners(Bitmap src, Bitmap dest, int radius, int clearColor) {
        clearBitmap(dest, clearColor);
        Canvas canvas = new Canvas(dest);

        Rect sourceRect = WorkCache.RECT1.get();
        Rect destRect = WorkCache.RECT2.get();
        sourceRect.set(0, 0, src.getWidth(), src.getHeight());
        destRect.set(0, 0, dest.getWidth(), dest.getHeight());

        RectF roundRect = WorkCache.RECTF1.get();
        roundRect.set(0, 0, dest.getWidth(), dest.getHeight());

        Paint paint = WorkCache.PAINT.get();
        paint.reset();
        paint.setStyle(Paint.Style.FILL);
        paint.setColor(Color.RED);
        paint.setAntiAlias(true);
        canvas.drawRoundRect(roundRect, radius, radius, paint);

        paint.reset();
        paint.setFilterBitmap(true);
        paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
        canvas.drawBitmap(src, sourceRect, destRect, paint);

        canvas.setBitmap(null);
    }
349221
public static void drawRoundedCorners(Bitmap src, Bitmap dest, int radius) {
        drawRoundedCorners(src, dest, radius, CLEAR_COLOR);
    }
722295
@Override
	@Pure
	protected Rectangle2d calcBounds() {
		double x = this.getX();
		double y = this.getY();

		final double w = this.radius * 2;
		final double h = w;

		x -= w / 2.;
		y -= h / 2.;

		return new Rectangle2d(x, y, w, h);
	}
766108
protected void setLoadingDrawable(LoadingDrawable drawable) {
        if (drawable == null) {
            throw new NullPointerException("LoadingDrawable is null, You can only set the STYLE_CIRCLE and STYLE_LINE parameters.");
        } else {
            drawable.setCallback(this);
            mLoadingDrawable = drawable;

            invalidate();
            requestLayout();
        }
    }
727702
private void setChildDrawableAtIndex(int index, @Nullable Drawable drawable) {
    if (drawable == null) {
      mFadeDrawable.setDrawable(index, null);
      return;
    }
    drawable = WrappingUtils.maybeApplyLeafRounding(drawable, mRoundingParams, mResources);
    getParentDrawableAtIndex(index).setDrawable(drawable);
  }
714203
public void setSelectionDrawable(@NonNull Drawable drawable) {
    if (drawable == null) {
      throw new IllegalArgumentException("Cannot be null");
    }
    selectionDrawable = drawable;
    isDecorated = true;
  }