fix old mipmaps code: tex size could be = 0

This commit is contained in:
Garux
2018-06-10 01:27:49 +03:00
parent f83dc2e891
commit c3a110bf2c
3 changed files with 5 additions and 17 deletions

View File

@@ -609,15 +609,11 @@ int TextureBrowser_TotalHeight( TextureBrowser& textureBrowser ){
return textureBrowser.m_nTotalHeight;
}
inline const int& min_int( const int& left, const int& right ){
return std::min( left, right );
}
void TextureBrowser_clampOriginY( TextureBrowser& textureBrowser ){
if ( textureBrowser.originy > 0 ) {
textureBrowser.originy = 0;
}
int lower = min_int( textureBrowser.height - TextureBrowser_TotalHeight( textureBrowser ), 0 );
const int lower = std::min( textureBrowser.height - TextureBrowser_TotalHeight( textureBrowser ), 0 );
if ( textureBrowser.originy < lower ) {
textureBrowser.originy = lower;
}