public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js
function(group)
	{
	    var bounds = {};
	    
	    var setBound = function(position)
		{
		    var left, top;
		    left = position[0];
		    top = position[1];
		    
		    if ((typeof bounds["left"] == "undefined") || bounds["left"] > left)
			bounds["left"] = left;
			
		    if ((typeof bounds["right"] == "undefined") || bounds["right"] < left)
			bounds["right"] = left;

		    if ((typeof bounds["top"] == "undefined") || bounds["top"] > top)
			bounds["top"] = top;

		    if ((typeof bounds["bottom"] == "undefined") || bounds["bottom"] < top)
			bounds["bottom"] = top;
		}
	    
	    if (lang.isObject(group.groupContainer))
	    {
		setBound(group.groupContainer.getConfig().position)
	    }
	    else
	    {
		for (var cI in group.containers)
		{
		    var c = group.containers[cI].container;
		    var config = c.getConfig();
		    
		    setBound(config.position);
		}
		
		for (var gI in group.groups)
		{
		    var g = group.groups[gI].group;
		    
		    setBound(WireIt.GroupUtils.workOutCenter(g));
		}
	    }
	    return [
		    ((bounds.right + bounds.left)/2),
		    ((bounds.top + bounds.bottom)/2)
		];
	}
function(group)
	{
	    var bounds = {};
	    
	    var setBound = function(position)
		{
		    var left, top;
		    left = position[0];
		    top = position[1];
		    
		    if ((typeof bounds["left"] == "undefined") || bounds["left"] > left)
			bounds["left"] = left;
			
		    if ((typeof bounds["right"] == "undefined") || bounds["right"] < left)
			bounds["right"] = left;

		    if ((typeof bounds["top"] == "undefined") || bounds["top"] > top)
			bounds["top"] = top;

		    if ((typeof bounds["bottom"] == "undefined") || bounds["bottom"] < top)
			bounds["bottom"] = top;
		}
	    
	    if (lang.isObject(group.groupContainer))
	    {
		setBound(group.groupContainer.getConfig().position)
	    }
	    else
	    {
		for (var cI in group.containers)
		{
		    var c = group.containers[cI].container;
		    var config = c.getConfig();
		    
		    setBound(config.position);
		}
		
		for (var gI in group.groups)
		{
		    var g = group.groups[gI].group;
		    
		    setBound(WireIt.GroupUtils.workOutCenter(g));
		}
	    }
	    return [
		    ((bounds.right + bounds.left)/2),
		    ((bounds.top + bounds.bottom)/2)
		];
	}
function ( group ) { var bounds = { } ; var setBound = function ( position ) { var left , top ; left = position [ 0 ] ; top = position [ 1 ] ; if ( ( typeof bounds [ "left" ] == "undefined" ) || bounds [ "left" ] > left ) bounds [ "left" ] = left ; if ( ( typeof bounds [ "right" ] == "undefined" ) || bounds [ "right" ] < left ) bounds [ "right" ] = left ; if ( ( typeof bounds [ "top" ] == "undefined" ) || bounds [ "top" ] > top ) bounds [ "top" ] = top ; if ( ( typeof bounds [ "bottom" ] == "undefined" ) || bounds [ "bottom" ] < top ) bounds [ "bottom" ] = top ; } if ( lang . isObject ( group . groupContainer ) ) { setBound ( group . groupContainer . getConfig ( ) . position ) } else { for ( var cI in group . containers ) { var c = group . containers [ cI ] . container ; var config = c . getConfig ( ) ; setBound ( config . position ) ; } for ( var gI in group . groups ) { var g = group . groups [ gI ] . group ; setBound ( WireIt . GroupUtils . workOutCenter ( g ) ) ; } } return [ ( ( bounds . right + bounds . left ) / 2 ) , ( ( bounds . top + bounds . bottom ) / 2 ) ] ; }
Works out the center point of a group
@param {WireIt.Group} group The group to get the center of
@return {Array} the x, y position of the center
Works out the center point of a group