Skip to content

Commit

Permalink
Fix rounding bug in update editor JS
Browse files Browse the repository at this point in the history
  • Loading branch information
joemcgill committed Feb 5, 2015
1 parent b2de24e commit 4314d38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/wp-tevko-responsive-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
_.each(sizes, function(size){
var softHeight = Math.round( size.width * metadata.height / metadata.width );

if (softHeight === size.height) {
// If the height is within 1 integer of the expected height, let it pass.
if ( size.height >= softHeight - 1 && size.height <= softHeight + 1 ) {
srcsetGroup.push(size.url + ' ' + size.width + 'w');
}
});
Expand Down

0 comments on commit 4314d38

Please sign in to comment.