Skip to content

Commit

Permalink
Added a tolerance of 1E-3 around required icon aspect ratios, see #263
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Oct 23, 2015
1 parent 273cb5c commit 8d87df6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/NavigationBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ define( function( require ) {
for ( var screenIndex = 0; screenIndex < screens.length; screenIndex++ ) {
var screen = screens[ screenIndex ];
var iconAspectRatio = screen.navigationBarIcon.width / screen.navigationBarIcon.height;
var validAspectRatio = iconAspectRatio === navbarIconAspectRatio || iconAspectRatio === homeScreenIconAspectRatio;
var tolerance = 1E-3;
var validAspectRatio = Math.abs( iconAspectRatio - navbarIconAspectRatio ) < tolerance || Math.abs( iconAspectRatio - homeScreenIconAspectRatio ) < tolerance;
assert && assert( validAspectRatio, 'NavigationBar icons for screen ' + screenIndex + ' did not have a valid aspect ratio.' );
}
}
Expand Down

0 comments on commit 8d87df6

Please sign in to comment.