CornerRounding
-
Cmn
class CornerRounding
CornerRounding defines the amount and quality around a given vertex of a shape. radius defines the radius of the circle which forms the basis of the rounding for the vertex. smoothing defines the amount by which the curve is extended from the circular arc around the corner to the edge between vertices.
Each corner of a shape can be thought of as either:
Summary
Public companion properties |
||
|---|---|---|
CornerRounding |
|
Cmn
|
Public constructors |
|
|---|---|
CornerRounding( |
Cmn
|
Public properties |
||
|---|---|---|
Float |
a value of 0 or greater, representing the radius of the circle which defines the inner rounding arc of the corner. |
Cmn
|
Float |
the amount by which the arc is "smoothed" by extending the curve from the inner circular arc to the edge between vertices. |
Cmn
|
Public companion properties
Unrounded
val Unrounded: CornerRounding
Unrounded has a rounding radius of zero, producing a sharp corner at a vertex.
Public constructors
CornerRounding
CornerRounding(
radius: @FloatRange(from = 0.0) Float = 0.0f,
smoothing: @FloatRange(from = 0.0, to = 1.0) Float = 0.0f
)
| Parameters | |
|---|---|
radius: @FloatRange(from = 0.0) Float = 0.0f |
a value of 0 or greater, representing the radius of the circle which defines the inner rounding arc of the corner. A value of 0 indicates that the corner is sharp, or completely unrounded. A positive value is the requested size of the radius. Note that this radius is an absolute size that should relate to the overall size of its shape. Thus if the shape is in screen coordinate size, the radius should be sized appropriately. If the shape is in some canonical form (bounds of (-1,-1) to (1,1), for example, which is the default when creating a |
smoothing: @FloatRange(from = 0.0, to = 1.0) Float = 0.0f |
the amount by which the arc is "smoothed" by extending the curve from the inner circular arc to the edge between vertices. A value of 0 (no smoothing) indicates that the corner is rounded by only a circular arc; there are no flanking curves. A value of 1 indicates that there is no circular arc in the center; the flanking curves on either side meet at the middle. |
Public properties
radius
val radius: Float
a value of 0 or greater, representing the radius of the circle which defines the inner rounding arc of the corner. A value of 0 indicates that the corner is sharp, or completely unrounded. A positive value is the requested size of the radius. Note that this radius is an absolute size that should relate to the overall size of its shape. Thus if the shape is in screen coordinate size, the radius should be sized appropriately. If the shape is in some canonical form (bounds of (-1,-1) to (1,1), for example, which is the default when creating a RoundedPolygon from a number of vertices), then the radius should be relative to that size. The radius will be scaled if the shape itself is transformed, since it will produce curves which round the corner and thus get transformed along with the overall shape.
smoothing
val smoothing: Float
the amount by which the arc is "smoothed" by extending the curve from the inner circular arc to the edge between vertices. A value of 0 (no smoothing) indicates that the corner is rounded by only a circular arc; there are no flanking curves. A value of 1 indicates that there is no circular arc in the center; the flanking curves on either side meet at the middle.