public static int CompareByArea( Element _a, Element _b )
{
int ret = (int)_a.trimRect.width * (int)_a.trimRect.height -
(int)_b.trimRect.width * (int)_b.trimRect.height;
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;
}