SelfOverlap


public final 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 StockBrushes.highlighter or StockBrushes.emojiHighlighter.

Summary

Public fields

static final @NonNull SelfOverlap

Self overlap will be accumulated, meaning that both the overlapped content and the overlapping content will be drawn.

static final @NonNull 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.

static final @NonNull SelfOverlap

Self overlap will be drawn in a way that discards the overlapping content.

Public methods

@NonNull String

Public fields

ACCUMULATE

public static final @NonNull SelfOverlap ACCUMULATE

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 ANY is used because it leads to the most performant rendering. This cannot be rendered on Android devices before API level U.

ANY

public static final @NonNull 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.

DISCARD

public static final @NonNull SelfOverlap DISCARD

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 BrushPaint.TextureMapping.Companion.TILING. This is the default behavior for Android T and below when ANY is used, and can also be used on Android U and above if desired.

Public methods

toString

public @NonNull String toString()