CanvasKt

Added in 1.1.0

public final class CanvasKt


Summary

Public methods

static final void
withClip(
    @NonNull Canvas receiver,
    @NonNull Path clipPath,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.clipPath and Canvas.restoreToCount.

static final void
withClip(
    @NonNull Canvas receiver,
    @NonNull Rect clipRect,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.clipRect and Canvas.restoreToCount.

static final void
withClip(
    @NonNull Canvas receiver,
    @NonNull RectF clipRect,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.clipRect and Canvas.restoreToCount.

static final void
withClip(
    @NonNull Canvas receiver,
    float left,
    float top,
    float right,
    float bottom,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.clipRect and Canvas.restoreToCount.

static final void
withClip(
    @NonNull Canvas receiver,
    int left,
    int top,
    int right,
    int bottom,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.clipRect and Canvas.restoreToCount.

static final void
withMatrix(
    @NonNull Canvas receiver,
    @NonNull Matrix matrix,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.concat and Canvas.restoreToCount.

static final void
withRotation(
    @NonNull Canvas receiver,
    float degrees,
    float pivotX,
    float pivotY,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.rotate and Canvas.restoreToCount.

static final void
withSave(
    @NonNull Canvas receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save and Canvas.restoreToCount.

static final void
withScale(
    @NonNull Canvas receiver,
    float x,
    float y,
    float pivotX,
    float pivotY,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.scale and Canvas.restoreToCount.

static final void
withSkew(
    @NonNull Canvas receiver,
    float x,
    float y,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.skew and Canvas.restoreToCount.

static final void
withTranslation(
    @NonNull Canvas receiver,
    float x,
    float y,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.translate and Canvas.restoreToCount.

Public methods

withClip

public static final void withClip(
    @NonNull Canvas receiver,
    @NonNull Path clipPath,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.clipPath and Canvas.restoreToCount.

withClip

public static final void withClip(
    @NonNull Canvas receiver,
    @NonNull Rect clipRect,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.clipRect and Canvas.restoreToCount.

withClip

public static final void withClip(
    @NonNull Canvas receiver,
    @NonNull RectF clipRect,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.clipRect and Canvas.restoreToCount.

withClip

public static final void withClip(
    @NonNull Canvas receiver,
    float left,
    float top,
    float right,
    float bottom,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.clipRect and Canvas.restoreToCount.

withClip

public static final void withClip(
    @NonNull Canvas receiver,
    int left,
    int top,
    int right,
    int bottom,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.clipRect and Canvas.restoreToCount.

withMatrix

public static final void withMatrix(
    @NonNull Canvas receiver,
    @NonNull Matrix matrix,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.concat and Canvas.restoreToCount.

withRotation

public static final void withRotation(
    @NonNull Canvas receiver,
    float degrees,
    float pivotX,
    float pivotY,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.rotate and Canvas.restoreToCount.

withSave

public static final void withSave(
    @NonNull Canvas receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save and Canvas.restoreToCount.

withScale

public static final void withScale(
    @NonNull Canvas receiver,
    float x,
    float y,
    float pivotX,
    float pivotY,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.scale and Canvas.restoreToCount.

withSkew

public static final void withSkew(
    @NonNull Canvas receiver,
    float x,
    float y,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.skew and Canvas.restoreToCount.

withTranslation

public static final void withTranslation(
    @NonNull Canvas receiver,
    float x,
    float y,
    @ExtensionFunctionType @NonNull Function1<@NonNull CanvasUnit> block
)

Wrap the specified block in calls to Canvas.save/Canvas.translate and Canvas.restoreToCount.