src/modules/range-util/index.js
function(r1, c1, r2, c2) {
        var range = {};
        if (r1 < r2) {
            range.top = r1;
            range.height = r2 - r1 + 1;
        } else {
            range.top = r2;
            range.height = r1 - r2 + 1;
        }

        if (c1 < c2) {
            range.left = c1;
            range.width = c2 - c1 + 1;
        } else {
            range.left = c2;
            range.width = c1 - c2 + 1;
        }
        return range;
    }
function(r1, c1, r2, c2) {
        var range = {};
        if (r1 < r2) {
            range.top = r1;
            range.height = r2 - r1 + 1;
        } else {
            range.top = r2;
            range.height = r1 - r2 + 1;
        }

        if (c1 < c2) {
            range.left = c1;
            range.width = c2 - c1 + 1;
        } else {
            range.left = c2;
            range.width = c1 - c2 + 1;
        }
        return range;
    }
function ( r1 , c1 , r2 , c2 ) { var range = { } ; if ( r1 < r2 ) { range . top = r1 ; range . height = r2 - r1 + 1 ; } else { range . top = r2 ; range . height = r1 - r2 + 1 ; } if ( c1 < c2 ) { range . left = c1 ; range . width = c2 - c1 + 1 ; } else { range . left = c2 ; range . width = c1 - c2 + 1 ; } return range ; }
takes two row, col points and creates a normal position range
takes two row col points and creates a normal position range