public static int CompareByWidthRotate( Element _a, Element _b )
{
int a_size = (int)_a.trimRect.height;
if ( (int)_a.trimRect.height > (int)_a.trimRect.width ) {
a_size = (int)_a.trimRect.height;
_a.rotated = true;
}
int b_size = (int)_b.trimRect.height;
if ( (int)_b.trimRect.height > (int)_b.trimRect.width ) {
b_size = (int)_b.trimRect.height;
_b.rotated = true;
}
int ret = a_size - b_size;
if ( ret == 0 ) {
ret = string.Compare( exEditorHelper.AssetToGUID(_a.texture), exEditorHelper.AssetToGUID(_b.texture) );
}
if ( _a.isFontElement && _b.isFontElement && ret == 0 ) {
ret = _a.charInfo.id - _b.charInfo.id;
}
return ret;
}