Configure Snapping
PhotoEditor SDK supports several configuration options to customize the snapping behavior globally for all sprites in the editor. For a detailed explanation of how to configure different editor views, refer to this guide.
In this example, configuration, the editor's snapping behavior is configured to act as a guide for the user to see where the sprites should be placed. A use case could be that an application displays the photos both in rectangular as well as in circular shapes which requires the editor to indicate in which area the sprites' visibility is best.
rotationSnappingEnabled
#
rotationSnappingEnabled
#By default, the snapping is enabled when rotating a sprite. In this example, this behavior is disabled since only the outer positional snapping guides are needed.
snapToVerticalCenterLine
#
snapToVerticalCenterLine
#If set to true
(by default) the center of the sprite snaps to a vertical line indicating the center of the photo.
In this example, this behavior is disabled since only the outer positional snapping guides are needed.
snapToHorizontalCenterLine
#
snapToHorizontalCenterLine
#If set to true
(by default) By default, the center of the sprite snaps to a horizontal line indicating the center of the photo.
In this example, this behavior is disabled since only the outer positional snapping guides are needed.
Outer positional snapping#
Sprites snap to the border of the photo along horizontal and vertical lines. by default, these lines are placed at a distance of 10% of the smaller side of the photo from the border (corresponding to 0.1). In this example, we want to increase this distance to 15% to define the visibility of the photo.