# PathOperation

Artifact: [androidx.compose.ui:ui-graphics](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/PathOperation.kt+class:androidx.compose.ui.graphics.PathOperation) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  value class PathOperation
  ```

*** ** * ** ***

Strategies for combining paths.

See also:

- `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Path#combine(androidx.compose.ui.graphics.PathOperation,androidx.compose.ui.graphics.Path,androidx.compose.ui.graphics.Path)`, which uses this enum to decide how to combine two paths.

## Summary

| ### Nested types |
|---|
| `object https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation.Companion` |

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation#Difference()` Subtract the second path from the first path. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation#Intersect()` Create a new path that is the intersection of the two paths, leaving the overlapping pieces of the path. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation#ReverseDifference()` Subtract the first path from the second path. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation#Union()` Create a new path that is the union (inclusive-or) of the two paths. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation#Xor()` Create a new path that is the exclusive-or of the two paths, leaving everything but the overlapping pieces of the path. | Cmn |

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation#toString()()` | Cmn |

## Public companion properties

### Difference

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Difference: PathOperation
```

Subtract the second path from the first path.

For example, if the two paths are overlapping circles of equal diameter but differing centers, the result would be a crescent portion of the first circle that was not overlapped by the second circle.

See also:

- `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation#ReverseDifference()`, which is the same but subtracting the first path from the second.

### Intersect

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Intersect: PathOperation
```

Create a new path that is the intersection of the two paths, leaving the overlapping pieces of the path.

For example, if the two paths are overlapping circles of equal diameter but differing centers, the result would be only the overlapping portion of the two circles.

See also:

- `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation#Xor()`, which is the inverse of this operation

### ReverseDifference

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val ReverseDifference: PathOperation
```

Subtract the first path from the second path.

For example, if the two paths are overlapping circles of equal diameter but differing centers, the result would be a crescent portion of the second circle that was not overlapped by the first circle.

See also:

- `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation#Difference()`, which is the same but subtracting the second path from the first.

### Union

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Union: PathOperation
```

Create a new path that is the union (inclusive-or) of the two paths.

For example, if the two paths are overlapping circles of equal diameter but differing centers, the result would be a figure-eight like shape matching the outer boundaries of both circles.

### Xor

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Xor: PathOperation
```

Create a new path that is the exclusive-or of the two paths, leaving everything but the overlapping pieces of the path.

For example, if the two paths are overlapping circles of equal diameter but differing centers, the figure-eight like shape less the overlapping parts

See also:

- `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathOperation#Intersect()`, which is the inverse of this operation

## Public functions

### toString

Cmn

```
open fun toString(): String
```