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:
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user