# SelfOverlap

Artifact: [androidx.ink:ink-brush](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/brush/SelfOverlap.kt+class:androidx.ink.brush.SelfOverlap) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOS
- Cmn

  ```
  class SelfOverlap
  ```

*** ** * ** ***

Specifies how parts of the stroke that intersect itself should be treated during the rendering process. The simplest example of this is with translucent, solid-color strokes - such as `https://developer.android.com/reference/kotlin/androidx/ink/brush/StockBrushes#highlighter(androidx.ink.brush.SelfOverlap,androidx.ink.brush.StockBrushes.HighlighterVersion)` or `https://developer.android.com/reference/kotlin/androidx/ink/brush/StockBrushes#emojiHighlighter(kotlin.String,kotlin.Boolean,androidx.ink.brush.SelfOverlap,androidx.ink.brush.StockBrushes.EmojiHighlighterVersion)`.

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap#ACCUMULATE()` Self overlap will be accumulated, meaning that both the overlapped content and the overlapping content will be drawn. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap#ANY()` Any of the options listed below may be used, depending on what would be most efficient and feature-complete for the brush and the device. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap#DISCARD()` Self overlap will be drawn in a way that discards the overlapping content. | Cmn |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap#calculateMinimumRequiredVersion()()` Returns the minimum required `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` for this `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap`. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap#toString()()` | Cmn |

## Public companion properties

### ACCUMULATE

Cmn

```
val ACCUMULATE: SelfOverlap
```

Self overlap will be accumulated, meaning that both the overlapped content and the overlapping content will be drawn. For a translucent color stroke, this typically means that the overlapping portion will appear with double the opacity of the non-overlapping portions. This option is most analogous to physical writing and drawing, and it is the option that best matches the appearance as if the stroke were drawn as separate, shorter strokes. This is the default behavior for Android U and above when `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap#ANY()` is used because it leads to the most performant rendering. This cannot be rendered on Android devices before API level U.

### ANY

Cmn

```
val ANY: SelfOverlap
```

Any of the options listed below may be used, depending on what would be most efficient and feature-complete for the brush and the device.

### DISCARD

Cmn

```
val DISCARD: SelfOverlap
```

Self overlap will be drawn in a way that discards the overlapping content. This can be used to make the stroke appear as if it's drawn as a PDF page object or annotation, where a stroke can be filled only with a solid color or textures using `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TilingTexture`. This is the default behavior for Android T and below when `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap#ANY()` is used, and can also be used on Android U and above if desired.

This is incompatible with `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushBehavior`s which target opacity or color, and with `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.StampingTexture`. This is because `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap#DISCARD()` forces usage of the path renderer, and the aforementioned features require the mesh renderer. In the case where both are specified on the same `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushCoat`, the effects of the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushBehavior` or `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.StampingTexture` will not be rendered.

## Public functions

### calculateMinimumRequiredVersion

Cmn Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
fun calculateMinimumRequiredVersion(): Version
```

Returns the minimum required `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` for this `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap`.

By default, decoding a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` containing a `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap` with a minimum required version higher than `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version#MAX_SUPPORTED()` will fail.

### toString

Cmn

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