double left = ocx - owidth / 2;
double right = ocx + owidth / 2;
double top = ocy - oheight / 2;
double bottom = ocy + oheight / 2;
Rect topLeft = createHitRectangle(left, top);
Rect topRight = createHitRectangle(right, top);
Rect bottomLeft = createHitRectangle(left, bottom);
Rect bottomRight = createHitRectangle(right, bottom);
Rect center = new Rect(left, top, owidth, oheight);
if (topLeft.contains(pt)) {
dragState = DragState.TOP_LEFT;
} else if (topRight.contains(pt)) {
dragState = DragState.TOP_RIGHT;
} else if (bottomLeft.contains(pt)) {
dragState = DragState.BOTTOM_LEFT;
} else if (bottomRight.contains(pt)) {
dragState = DragState.BOTTOM_RIGHT;
} else if (center.contains(pt)) {
dragState = DragState.CENTER;
} else {
dragState = DragState.NONE;
return false;
}