CornerMask
in package
implements
JsonSerializable
FinalYes
Rounded corner clipping for components.
Tags
Table of Contents
Interfaces
- JsonSerializable
Constants
- TYPE_CORNERS = 'corners'
- Valid mask types.
Properties
- $bottomLeft : bool|null
- Whether to mask bottom-left corner.
- $bottomRight : bool|null
- Whether to mask bottom-right corner.
- $radius : int|null
- The corner radius.
- $topLeft : bool|null
- Whether to mask top-left corner.
- $topRight : bool|null
- Whether to mask top-right corner.
- $type : string
- The mask type.
Methods
- bottomOnly() : self
- Create a bottom corners only mask.
- jsonSerialize() : array<string, mixed>
- {@inheritdoc}
- setCorners() : $this
- Set which corners to mask.
- setRadius() : $this
- Set the corner radius.
- topOnly() : self
- Create a top corners only mask.
- uniform() : self
- Create a uniform corner mask.
Constants
TYPE_CORNERS
Valid mask types.
public
mixed
TYPE_CORNERS
= 'corners'
Properties
$bottomLeft
Whether to mask bottom-left corner.
private
bool|null
$bottomLeft
= null
$bottomRight
Whether to mask bottom-right corner.
private
bool|null
$bottomRight
= null
$radius
The corner radius.
private
int|null
$radius
= null
$topLeft
Whether to mask top-left corner.
private
bool|null
$topLeft
= null
$topRight
Whether to mask top-right corner.
private
bool|null
$topRight
= null
$type
The mask type.
private
string
$type
= self::TYPE_CORNERS
Methods
bottomOnly()
Create a bottom corners only mask.
public
static bottomOnly(int $radius) : self
Parameters
- $radius : int
-
The corner radius.
Return values
self —A new instance.
jsonSerialize()
{@inheritdoc}
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>setCorners()
Set which corners to mask.
public
setCorners([bool $topLeft = true ][, bool $topRight = true ][, bool $bottomLeft = true ][, bool $bottomRight = true ]) : $this
Parameters
- $topLeft : bool = true
-
Whether to round top-left.
- $topRight : bool = true
-
Whether to round top-right.
- $bottomLeft : bool = true
-
Whether to round bottom-left.
- $bottomRight : bool = true
-
Whether to round bottom-right.
Return values
$thissetRadius()
Set the corner radius.
public
setRadius(int $radius) : $this
Parameters
- $radius : int
-
The radius in points.
Return values
$thistopOnly()
Create a top corners only mask.
public
static topOnly(int $radius) : self
Parameters
- $radius : int
-
The corner radius.
Return values
self —A new instance.
uniform()
Create a uniform corner mask.
public
static uniform(int $radius) : self
Parameters
- $radius : int
-
The corner radius.
Return values
self —A new instance.