evolve4src/src/evolve/ZoomHistory.cpp
void ZoomHistory::preserve_aspect_ratio()
{
	double window_ratio;
	double world_ratio;

	window_ratio = (win.bottom - win.top) / (win.right - win.left);
	world_ratio = (world.bottom - world.top) / (world.right - world.left);

	if( world_ratio > window_ratio ) {
		win.right = win.left +
				(win.bottom - win.top) / world_ratio;
	} else {
		win.bottom = win.top +
				(win.right - win.left) * world_ratio;
	}

}
/*
 * Change 'win' so its aspect ration matches the aspect ratio
 * of the 'world' rectangle.
 *
 */
Change 'win' so its aspect ration matches the aspect ratio
of the 'world' rectangle.
Change ' win ' so its aspect ration matches the aspect ratio of the ' world ' rectangle .
void ZoomHistory::preserve_aspect_ratio()
{
	double window_ratio;
	double world_ratio;
	window_ratio = (win.bottom - win.top) / (win.right - win.left);
	world_ratio = (world.bottom - world.top) / (world.right - world.left);
	if( world_ratio > window_ratio ) {
		win.right = win.left +
				(win.bottom - win.top) / world_ratio;
	} else {
		win.bottom = win.top +
				(win.right - win.left) * world_ratio;
	}
}
void ZoomHistory :: preserve_aspect_ratio ( ) { double window_ratio ; double world_ratio ; window_ratio = ( win . bottom - win . top ) / ( win . right - win . left ) ; world_ratio = ( world . bottom - world . top ) / ( world . right - world . left ) ; if ( world_ratio > window_ratio ) { win . right = win . left + ( win . bottom - win . top ) / world_ratio ; } else { win . bottom = win . top + ( win . right - win . left ) * world_ratio ; } }
Change 'win' so its aspect ration matches the aspect ratio
 of the 'world' rectangle.
Change ' win ' so its aspect ration matches the aspect ratio of the ' world ' rectangle .