ZoomToWidth/ZoomToHeight obeys crop. This way,

CropToAspectRatio,16/9;
  ZoomToWidth,SCREEN_WIDTH;
  ZoomToHeight,SCREEN_HEIGHT
will zoom to the center 16:9 area of the image.
This commit is contained in:
Glenn Maynard
2005-11-30 23:11:31 +00:00
parent c607f34d3a
commit 76f05625d5
2 changed files with 17 additions and 2 deletions
+15
View File
@@ -845,6 +845,21 @@ void Actor::CropToAspectRatio( float fAspect )
}
}
/* Zoom the uncropped region to the given size. */
void Actor::ZoomToWidth( float zoom )
{
float fWidth = GetUnzoomedWidth();
fWidth *= 1-(GetCropLeft()+GetCropRight());
SetZoomX( zoom / fWidth );
}
void Actor::ZoomToHeight( float zoom )
{
float fHeight = GetUnzoomedHeight();
fHeight *= 1-(GetCropTop()+GetCropBottom());
SetZoomY( zoom / fHeight );
}
void Actor::SetHorizAlignString( const CString &s )
{