---
title: "CornerBasedShape"
description: "Base class for [Shape]s defined by four [CornerSize]s."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
abstract class CornerBasedShape(
    val topStart: CornerSize,
    val topEnd: CornerSize,
    val bottomEnd: CornerSize,
    val bottomStart: CornerSize,
) : Shape, Interpolatable
```


Base class for `Shape`s defined by four `CornerSize`s.

#### Parameters

| | |
| --- | --- |
| topStart | a size of the top start corner |
| topEnd | a size of the top end corner |
| bottomEnd | a size of the bottom end corner |
| bottomStart | a size of the bottom start corner |



## Functions

```kotlin
abstract fun createOutline(
        size: Size,
        topStart: Float,
        topEnd: Float,
        bottomEnd: Float,
        bottomStart: Float,
        layoutDirection: LayoutDirection,
    ): Outline
```


Creates `Outline` of this shape for the given `size`.

#### Parameters

| | |
| --- | --- |
| size | the size of the shape boundary. |
| topStart | the resolved size of the top start corner |
| topEnd | the resolved size for the top end corner |
| bottomEnd | the resolved size for the bottom end corner |
| bottomStart | the resolved size for the bottom start corner |
| layoutDirection | the current layout direction. |



```kotlin
abstract fun copy(
        topStart: CornerSize = this.topStart,
        topEnd: CornerSize = this.topEnd,
        bottomEnd: CornerSize = this.bottomEnd,
        bottomStart: CornerSize = this.bottomStart,
    ): CornerBasedShape
```


Creates a copy of this Shape with a new corner sizes.

#### Parameters

| | |
| --- | --- |
| topStart | a size of the top start corner |
| topEnd | a size of the top end corner |
| bottomEnd | a size of the bottom end corner |
| bottomStart | a size of the bottom start corner |



```kotlin
fun copy(all: CornerSize): CornerBasedShape
```


Creates a copy of this Shape with a new corner size.

#### Parameters

| | |
| --- | --- |
| all | a size to apply for all four corners |




