Created
August 29, 2015 18:42
-
-
Save axyz/5d5f3b1edfb915a7cfbf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _perfectRowsNumber(photos, screenWidth, screenHeight) { | |
const idealHeight = parseInt(screenHeight / 2, 10); | |
const totalWidth = photos.reduce((sum, img) => sum + img.ratio * idealHeight, 0); | |
return Math.round(totalWidth / screenWidth); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment