Jetpack_Tiled_Gallery_Row

The Jetpack by WordPress.com Jetpack Tiled Gallery Row class.

Defined (1)

The class is defined in the following location(s).

/modules/tiled-gallery/tiled-gallery/tiled-gallery-rectangular.php  
  1. class Jetpack_Tiled_Gallery_Row { 
  2. public function __construct( $groups ) { 
  3. $this->groups = $groups; 
  4. $this->ratio = $this->get_ratio(); 
  5. $this->weighted_ratio = $this->get_weighted_ratio(); 
  6.  
  7. public function get_ratio() { 
  8. $ratio = 0; 
  9. foreach ( $this->groups as $group ) { 
  10. $ratio += $group->ratio; 
  11. return $ratio > 0? $ratio : 1; 
  12.  
  13. public function get_weighted_ratio() { 
  14. $weighted_ratio = 0; 
  15. foreach ( $this->groups as $group ) { 
  16. $weighted_ratio += $group->ratio * count( $group->images ); 
  17. return $weighted_ratio > 0 ? $weighted_ratio : 1;