Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PositionSnapping

Hierarchy

  • PositionSnapping

Index

Properties

Optional enabled

enabled: boolean = true

Whether sprites should snap to specific positions during pan interactions. This switch enables or disables position snapping.

example

// Defaults to:

true

Optional snapToBottom

snapToBottom: number | null = 0.1

The bottom side of a sprite's bounding box snaps to a horizontal line which is shifted by this value from the bottom side of the edited image towards its center. This value is measured in normalized coordinates relative to the smaller side of the edited image. If this value is explicitly set to null this snapping line is disabled.

example

// Defaults to:

0.1

Optional snapToHorizontalCenter

snapToHorizontalCenter: boolean = true

If enabled a sprite's center snaps to the horizontal line through the center of the edited image.

example

// Defaults to:

true

Optional snapToLeft

snapToLeft: number | null = 0.1

The left side of a sprite's bounding box snaps to a vertical line which is shifted by this value from the left side of the edited image towards its center. This value is measured in normalized coordinates relative to the smaller side of the edited image. If this value is explicitly set to null this snapping line is disabled.

example

// Defaults to:

0.1

Optional snapToRight

snapToRight: number | null = 0.1

The right side of a sprite's bounding box snaps to a vertical line which is shifted by this value from the right side of the edited image towards its center. This value is measured in normalized coordinates relative to the smaller side of the edited image. If this value is explicitly set to null this snapping line is disabled.

example

// Defaults to:

0.1

Optional snapToTop

snapToTop: number | null = 0.1

The top side of a sprite's bounding box snaps to a horizontal line which is shifted by this value from the top side of the edited image towards its center. This value is measured in normalized coordinates relative to the smaller side of the edited image. If this value is explicitly set to null this snapping line is disabled.

example

// Defaults to:

0.1

Optional snapToVerticalCenter

snapToVerticalCenter: boolean = true

If enabled a sprite's center snaps to the vertical line through the center of the edited image.

example

// Defaults to:

true

Optional threshold

threshold: number = 20

This threshold defines the distance of a pan gesture where snapping at a snap point occurs. It is measured in pixels.

example

// Defaults to:

20