-
public final class CropWindowMoveHandlerHandler to update crop window edges by the move type - Horizontal, Vertical, Corner or Center.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumCropWindowMoveHandler.TypeThe type of crop window move that is handled.
public classCropWindowMoveHandler.Companion
-
Constructor Summary
Constructors Constructor Description CropWindowMoveHandler(CropWindowMoveHandler.Type type, CropWindowHandler cropWindowHandler, Float touchX, Float touchY)
-
Method Summary
-
-
Constructor Detail
-
CropWindowMoveHandler
CropWindowMoveHandler(CropWindowMoveHandler.Type type, CropWindowHandler cropWindowHandler, Float touchX, Float touchY)
- Parameters:
cropWindowHandler- main crop window handle to get and update the crop window edgestouchX- the location of the initial toch possition to measure move distancetouchY- the location of the initial toch possition to measure move distance
-
-
Method Detail
-
move
final Unit move(RectF rect, Float x, Float y, RectF bounds, Integer viewWidth, Integer viewHeight, Float snapMargin, Boolean fixedAspectRatio, Float aspectRatio)
Updates the crop window by change in the toch location.<br></br> Move type handled by this instance, as initialized in creation, affects how the change in toch location changes the crop window position and size.<br></br> After the crop window position/size is changed by toch move it may result in values that vialate contraints: outside the bounds of the shown bitmap, smaller/larger than min/max size or missmatch in aspect ratio. So a series of fixes is executed on "secondary" edges to adjust it by the "primary" edge movement.<br></br> Primary is the edge directly affected by move type, secondary is the other edge.<br></br> The crop window is changed by directly setting the Edge coordinates.
- Parameters:
x- the new x-coordinate of this handley- the new y-coordinate of this handlebounds- the bounding rectangle of the imageviewWidth- The bounding image view width used to know the crop overlay is at view edges.viewHeight- The bounding image view height used to know the crop overlay is at view edges.snapMargin- the maximum distance (in pixels) at which the crop window should snap to the imagefixedAspectRatio- is the aspect ration fixed and 'targetAspectRatio' should be usedaspectRatio- the aspect ratio to maintain
-
-
-
-