Function to rescale dimenions of events.

This commit is contained in:
Kyle Johnson 2013-05-30 20:25:18 -04:00
parent e107e34164
commit c2e2079818
1 changed files with 12 additions and 1 deletions

View File

@ -40,4 +40,15 @@ class AppModel extends Model {
return $daemon_status; return $daemon_status;
} }
public function reScale( $dimension, $dummy) {
$scale_base = Configure::read('SCALE_BASE');
for ( $i = 1; $i < func_num_args(); $i++ ) {
$scale = func_get_arg( $i );
if ( !empty($scale) && $scale != $scale_base ) {
$dimension = (int)(($dimension*$scale)/$scale_base);
}
}
return( $dimension );
}
} }