src/aria/utils/resize/Resize.js
function (geometry, cursor, offX, offY) {
            var geometry = ariaUtilsJson.copy(geometry), trim = ariaUtilsString.trim;
            cursor = trim(cursor);
            var offsetX = geometry.width >= this.minWidth ? offX : 0;
            var offsetY = geometry.height >= this.minHeight ? offY : 0;

            switch (cursor) {
                case "n-resize" :
                    geometry.y += offsetY;
                    geometry.height -= offsetY;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "ne-resize" :
                    geometry.y += offsetY;
                    geometry.height -= offsetY;
                    geometry.width += offsetX;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "nw-resize" :
                    geometry.x += offsetX;
                    geometry.y += offsetY;
                    geometry.height -= offsetY;
                    geometry.width -= offsetX;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "s-resize" :
                    geometry.height += offsetY;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "se-resize" :
                    geometry.height += offsetY;
                    geometry.width += offsetX;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "sw-resize" :
                    geometry.x += offsetX;
                    geometry.height += offsetY;
                    geometry.width -= offsetX;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "e-resize" :
                    geometry.width += offsetX;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "w-resize" :
                    geometry.x += offsetX;
                    geometry.width -= offsetX;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
            }
            return geometry;
        }
function (geometry, cursor, offX, offY) {
            var geometry = ariaUtilsJson.copy(geometry), trim = ariaUtilsString.trim;
            cursor = trim(cursor);
            var offsetX = geometry.width >= this.minWidth ? offX : 0;
            var offsetY = geometry.height >= this.minHeight ? offY : 0;

            switch (cursor) {
                case "n-resize" :
                    geometry.y += offsetY;
                    geometry.height -= offsetY;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "ne-resize" :
                    geometry.y += offsetY;
                    geometry.height -= offsetY;
                    geometry.width += offsetX;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "nw-resize" :
                    geometry.x += offsetX;
                    geometry.y += offsetY;
                    geometry.height -= offsetY;
                    geometry.width -= offsetX;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "s-resize" :
                    geometry.height += offsetY;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "se-resize" :
                    geometry.height += offsetY;
                    geometry.width += offsetX;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "sw-resize" :
                    geometry.x += offsetX;
                    geometry.height += offsetY;
                    geometry.width -= offsetX;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "e-resize" :
                    geometry.width += offsetX;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
                case "w-resize" :
                    geometry.x += offsetX;
                    geometry.width -= offsetX;
                    geometry = this._fitResizeBoundary(geometry);
                    break;
            }
            return geometry;
        }
function ( geometry , cursor , offX , offY ) { var geometry = ariaUtilsJson . copy ( geometry ) , trim = ariaUtilsString . trim ; cursor = trim ( cursor ) ; var offsetX = geometry . width >= this . minWidth ? offX : 0 ; var offsetY = geometry . height >= this . minHeight ? offY : 0 ; switch ( cursor ) { case "n-resize" : geometry . y += offsetY ; geometry . height -= offsetY ; geometry = this . _fitResizeBoundary ( geometry ) ; break ; case "ne-resize" : geometry . y += offsetY ; geometry . height -= offsetY ; geometry . width += offsetX ; geometry = this . _fitResizeBoundary ( geometry ) ; break ; case "nw-resize" : geometry . x += offsetX ; geometry . y += offsetY ; geometry . height -= offsetY ; geometry . width -= offsetX ; geometry = this . _fitResizeBoundary ( geometry ) ; break ; case "s-resize" : geometry . height += offsetY ; geometry = this . _fitResizeBoundary ( geometry ) ; break ; case "se-resize" : geometry . height += offsetY ; geometry . width += offsetX ; geometry = this . _fitResizeBoundary ( geometry ) ; break ; case "sw-resize" : geometry . x += offsetX ; geometry . height += offsetY ; geometry . width -= offsetX ; geometry = this . _fitResizeBoundary ( geometry ) ; break ; case "e-resize" : geometry . width += offsetX ; geometry = this . _fitResizeBoundary ( geometry ) ; break ; case "w-resize" : geometry . x += offsetX ; geometry . width -= offsetX ; geometry = this . _fitResizeBoundary ( geometry ) ; break ; } return geometry ; }
Calculates the top, left position and size of the resizable element and new position of resize cursor.
@param {Object} geometry initial position and size of the resizable element
@param {String} cursor css class of resizable handle element
@param {Number} offX left position which resizable handle element has moved from its initial.
@param {Number} offY top position which resizable handle element has moved from its initial.
@return {Object} new position of resized and resize handle element
Calculates the top left position and size of the resizable element and new position of resize cursor .