static Rect ResizeTop(Rect currentRect, ResizeHandleState handleState, Event currentEvent, int minimumWidth, int minimumHeight) { currentRect.height = currentRect.height - (currentEvent.mousePosition.y - handleState.origin.y); currentRect.height = Mathf.Max(currentRect.height, minimumHeight); currentRect.y = handleState.startingRect.yMax - currentRect.height; return(currentRect); }
static Rect ResizeLeft(Rect currentRect, ResizeHandleState handleState, Event currentEvent, int minimumWidth, int minimumHeight) { currentRect.width = currentRect.width - (currentEvent.mousePosition.x - handleState.origin.x); currentRect.width = Mathf.Max(currentRect.width, minimumWidth); currentRect.x = handleState.startingRect.xMax - currentRect.width; return(currentRect); }
static Rect ResizeRight(Rect currentRect, ResizeHandleState handleState, Event currentEvent, int minimumWidth, int minimumHeight) { currentRect.width = handleState.startingRect.width + (currentEvent.mousePosition.x - handleState.origin.x); return(currentRect); }
static Rect ResizeBottom(Rect currentRect, ResizeHandleState handleState, Event currentEvent, int minimumWidth, int minimumHeight) { currentRect.height = handleState.startingRect.height + (currentEvent.mousePosition.y - handleState.origin.y); return(currentRect); }