public class HandleUtil
extends java.lang.Object
| Constructor and Description |
|---|
HandleUtil() |
| Modifier and Type | Method and Description |
|---|---|
static android.util.Pair<java.lang.Float,java.lang.Float> |
getOffset(Handle handle,
float x,
float y,
float left,
float top,
float right,
float bottom)
Calculates the offset of the touch point from the precise location of the
specified handle.
|
static Handle |
getPressedHandle(float x,
float y,
float left,
float top,
float right,
float bottom,
float targetRadius)
Determines which, if any, of the handles are pressed given the touch
coordinates, the bounding box, and the touch radius.
|
static float |
getTargetRadius(android.content.Context context)
Gets the default target radius (in pixels).
|
public static float getTargetRadius(@NonNull
android.content.Context context)
context - the Context@Nullable public static Handle getPressedHandle(float x, float y, float left, float top, float right, float bottom, float targetRadius)
x - the x-coordinate of the touch pointy - the y-coordinate of the touch pointleft - the x-coordinate of the left boundtop - the y-coordinate of the top boundright - the x-coordinate of the right boundbottom - the y-coordinate of the bottom boundtargetRadius - the target radius in pixels@Nullable
public static android.util.Pair<java.lang.Float,java.lang.Float> getOffset(@Nullable
Handle handle,
float x,
float y,
float left,
float top,
float right,
float bottom)