Revert cropping. "scaletocover,0,0,SCREEN_WIDTH,SCREEN_HEIGHT"
achieves the same effect.
This commit is contained in:
@@ -823,44 +823,6 @@ void Actor::ScaleTo( const RectF &rect, StretchType st )
|
||||
SetZoom( fNewZoom );
|
||||
}
|
||||
|
||||
/* Crop the actor to fit the specified aspect ratio. */
|
||||
void Actor::CropToAspectRatio( float fAspect )
|
||||
{
|
||||
float fActualAspect = GetUnzoomedWidth() / GetUnzoomedHeight();
|
||||
if( fActualAspect > fAspect )
|
||||
{
|
||||
/* The actual aspect ratio is wider than fAspect. */
|
||||
float fCropTo = fAspect / fActualAspect; /* .75 = crop to 75% size */
|
||||
float fCropBy = 1-fCropTo;
|
||||
SetCropLeft( fCropBy/2 );
|
||||
SetCropRight( fCropBy/2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The actual aspect ratio is taller than fAspect. */
|
||||
float fCropTo = fActualAspect / fAspect;
|
||||
float fCropBy = 1-fCropTo;
|
||||
SetCropTop( fCropBy/2 );
|
||||
SetCropBottom( fCropBy/2 );
|
||||
}
|
||||
}
|
||||
|
||||
/* 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 )
|
||||
{
|
||||
if (s.CompareNoCase("left")==0) this->SetHorizAlign( align_left ); /* call derived */
|
||||
@@ -1381,7 +1343,6 @@ public:
|
||||
static int croptop( T* p, lua_State *L ) { p->SetCropTop(FArg(1)); return 0; }
|
||||
static int cropright( T* p, lua_State *L ) { p->SetCropRight(FArg(1)); return 0; }
|
||||
static int cropbottom( T* p, lua_State *L ) { p->SetCropBottom(FArg(1)); return 0; }
|
||||
static int croptoaspectratio( T* p, lua_State *L ) { p->CropToAspectRatio(FArg(1)); return 0; }
|
||||
static int fadeleft( T* p, lua_State *L ) { p->SetFadeLeft(FArg(1)); return 0; }
|
||||
static int fadetop( T* p, lua_State *L ) { p->SetFadeTop(FArg(1)); return 0; }
|
||||
static int faderight( T* p, lua_State *L ) { p->SetFadeRight(FArg(1)); return 0; }
|
||||
@@ -1519,7 +1480,6 @@ public:
|
||||
ADD_METHOD( croptop );
|
||||
ADD_METHOD( cropright );
|
||||
ADD_METHOD( cropbottom );
|
||||
ADD_METHOD( croptoaspectratio );
|
||||
ADD_METHOD( fadeleft );
|
||||
ADD_METHOD( fadetop );
|
||||
ADD_METHOD( faderight );
|
||||
|
||||
Reference in New Issue
Block a user