Bug 83: Fixed broken number of columns in montage mode.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1456 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2005-06-12 18:09:56 +00:00
parent 978aeb5505
commit 87cafe0417
2 changed files with 4 additions and 7 deletions

View File

@ -78,9 +78,8 @@ while( $row = mysql_fetch_assoc( $result ) )
}
$monitors[] = $row = array_merge( $row, $row2, $row3 );
}
$max_cols = 8;
$montage_cols = (int)(($cycle_count+1)/((int)(($cycle_count-1)/ZM_WEB_MONTAGE_MAX_COLS)+1));
$montage_rows = intval(ceil($cycle_count/$montage_cols));
$montage_rows = intval((($cycle_count-1)/ZM_WEB_MONTAGE_MAX_COLS)+1);
$montage_cols = intval(ceil($cycle_count/$montage_rows));
$montage_width = ZM_WEB_MONTAGE_WIDTH?ZM_WEB_MONTAGE_WIDTH:$max_width;
$montage_height = ZM_WEB_MONTAGE_HEIGHT?ZM_WEB_MONTAGE_HEIGHT:$max_height;

View File

@ -48,10 +48,8 @@ while( $row = mysql_fetch_assoc( $result ) )
$monitors[] = $row;
}
$max_cols = 8;
$cols = (int)((count($monitors)+1)/((int)((count($monitors)-1)/ZM_WEB_MONTAGE_MAX_COLS)+1));
$rows = intval(ceil(count($monitors)/$cols));
$last_cols = count($monitors)%$rows;
$rows = intval(((count($monitors)-1)/ZM_WEB_MONTAGE_MAX_COLS)+1);
$cols = intval(ceil(count($monitors)/$rows));
$widths = array();
$heights = array();