Coordinates are floats, but our maximum resolutions should always be
integers. In 640x480 (4:3), with a 16:10 display, we were getting a 767.999939 width, instead of 768, which truncated to 767. Round the value consistently, so we always get 768x480.
This commit is contained in:
@@ -39,7 +39,7 @@ float ScreenDimensions::GetScreenWidth()
|
|||||||
if( fAspect > THEME_NATIVE_ASPECT )
|
if( fAspect > THEME_NATIVE_ASPECT )
|
||||||
fScale = fAspect / THEME_NATIVE_ASPECT;
|
fScale = fAspect / THEME_NATIVE_ASPECT;
|
||||||
ASSERT( fScale >= 1 );
|
ASSERT( fScale >= 1 );
|
||||||
return THEME_SCREEN_WIDTH * fScale;
|
return (float) lrintf(THEME_SCREEN_WIDTH * fScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
float ScreenDimensions::GetScreenHeight()
|
float ScreenDimensions::GetScreenHeight()
|
||||||
@@ -49,7 +49,7 @@ float ScreenDimensions::GetScreenHeight()
|
|||||||
if( fAspect < THEME_NATIVE_ASPECT )
|
if( fAspect < THEME_NATIVE_ASPECT )
|
||||||
fScale = THEME_NATIVE_ASPECT / fAspect;
|
fScale = THEME_NATIVE_ASPECT / fAspect;
|
||||||
ASSERT( fScale >= 1 );
|
ASSERT( fScale >= 1 );
|
||||||
return THEME_SCREEN_HEIGHT * fScale;
|
return (float) lrintf(THEME_SCREEN_HEIGHT * fScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenDimensions::ReloadScreenDimensions()
|
void ScreenDimensions::ReloadScreenDimensions()
|
||||||
|
|||||||
Reference in New Issue
Block a user