+ if ( bounds.size.height > r.size.height )
+ {
+ // portrait
+ if ( width )
+ *width = (int)bounds.size.width ;
+ if ( height )
+ *height = (int)bounds.size.height;
+ }
+ else
+ {
+ // landscape
+ if ( width )
+ *width = (int)bounds.size.height ;
+ if ( height )
+ *height = (int)bounds.size.width;
+ }