Table of Contents

Method GetUniformCornerRadius

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

GetUniformCornerRadius(RectD, float?, bool?)

Calculates a uniform corner radius for a rectangle, optionally treating the radius as a percentage of the rectangle's minimum dimension.

public static float? GetUniformCornerRadius(RectD rect, float? cornerRadius, bool? radiusIsPercent)

Parameters

rect RectD

The rectangle for which the corner radius is being calculated.

cornerRadius float?

The uniform corner radius to apply. If null, the method returns null.

radiusIsPercent bool?

A value indicating whether the cornerRadius is expressed as a percentage of the rectangle's minimum dimension. If null, the method returns null.

Returns

float?

The calculated corner radius as a float value. If cornerRadius or radiusIsPercent is null, the method returns null. If radiusIsPercent is true, the radius is calculated as a percentage of the rectangle's minimum dimension. Otherwise, the method returns the value of cornerRadius.

GetUniformCornerRadius(RectD)

Gets real uniform corner radius using UniformCornerRadius, UniformRadiusIsPercent and rect.

public virtual float? GetUniformCornerRadius(RectD rect)

Parameters

rect RectD

Rectangle for percentage calculation.

Returns

float?