Skip to main content
Language

Snapping Configuration Settings of PhotoEditor SDK

In this example, we will show you how to configure the PhotoEditor SDK.

Snapping Configuration#

The PE.SDK comes with a set of configuration parameters that let's you change the snapping behaviour of sprites in the Sticker, Text and Text Design tool.

position#

Snapping options for positioning sprites.

enabled#

Whether sprites should snap to specific positions during pan interactions.

threshold#

This threshold defines the distance of a pan gesture where snapping at a snap point occurs (value in pixels).

snapToHorizontalCenter#

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

snapToVerticalCenter#

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

snapToLeft#

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.

snapToRight#

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.

snapToTop#

The top side of a sprite's bounding box snaps to a vertical 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.

snapToBottom#

The bottom side of a sprite's bounding box snaps to a vertical 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.

rotation#

Snapping options for rotating sprites.

enabled#

Whether sprites should snap to specific orientations during rotation interactions.

threshold#

This threshold defines the arc length of a rotation gesture where snapping at a snap angle occurs (value in pixels).

angles#

Enabled snapping angles in degrees for rotating a sprite. The rotation angle is defined clockwise.