mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Fix split-screen UI wrong positioning on window resize
In vertical split at window heights below 1080, ComputeTileScale's min-scale clamp (>= 1.0) prevented the SWF from scaling down to fit, cropping the bottom and causing repositionHud to shift HUD elements downward. Chat and Tooltips additionally applied an offset from ComputeSplitContentOffset that only produced correct values at the 1920x1080 design resolution. Override the scale for vertical split so the SWF fits the full window height when it is shorter than the movie. Remove the broken content offset from Chat and Tooltips -- the tile crop already positions the content correctly.
This commit is contained in:
parent
28614b922f
commit
da7b6a77c8
|
|
@ -143,13 +143,17 @@ void UIComponent_Chat::render(S32 width, S32 height, C4JRender::eViewportType vi
|
||||||
|
|
||||||
F32 scale;
|
F32 scale;
|
||||||
ComputeTileScale(tileWidth, tileHeight, m_movieWidth, m_movieHeight, needsYTile, scale, tileYStart);
|
ComputeTileScale(tileWidth, tileHeight, m_movieWidth, m_movieHeight, needsYTile, scale, tileYStart);
|
||||||
IggyPlayerSetDisplaySize( getMovie(), (S32)(m_movieWidth * scale), (S32)(m_movieHeight * scale) );
|
|
||||||
|
|
||||||
S32 contentOffX, contentOffY;
|
// For vertical split, scale down to fit the full SWF height when the
|
||||||
ComputeSplitContentOffset(viewport, m_movieWidth, m_movieHeight, scale, tileWidth, tileHeight, tileYStart, contentOffX, contentOffY);
|
// window is shorter than the movie (same fix as HUD).
|
||||||
xPos += contentOffX;
|
if(!needsYTile && m_movieHeight > 0)
|
||||||
yPos += contentOffY;
|
{
|
||||||
ui.setupRenderPosition(xPos, yPos);
|
F32 scaleH = (F32)tileHeight / (F32)m_movieHeight;
|
||||||
|
if(scaleH < scale)
|
||||||
|
scale = scaleH;
|
||||||
|
}
|
||||||
|
|
||||||
|
IggyPlayerSetDisplaySize( getMovie(), (S32)(m_movieWidth * scale), (S32)(m_movieHeight * scale) );
|
||||||
|
|
||||||
IggyPlayerDrawTilesStart ( getMovie() );
|
IggyPlayerDrawTilesStart ( getMovie() );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -247,13 +247,17 @@ void UIComponent_Tooltips::render(S32 width, S32 height, C4JRender::eViewportTyp
|
||||||
|
|
||||||
F32 scale;
|
F32 scale;
|
||||||
ComputeTileScale(tileWidth, tileHeight, m_movieWidth, m_movieHeight, needsYTile, scale, tileYStart);
|
ComputeTileScale(tileWidth, tileHeight, m_movieWidth, m_movieHeight, needsYTile, scale, tileYStart);
|
||||||
IggyPlayerSetDisplaySize( getMovie(), (S32)(m_movieWidth * scale), (S32)(m_movieHeight * scale) );
|
|
||||||
|
|
||||||
S32 contentOffX, contentOffY;
|
// For vertical split, scale down to fit the full SWF height when the
|
||||||
ComputeSplitContentOffset(viewport, m_movieWidth, m_movieHeight, scale, tileWidth, tileHeight, tileYStart, contentOffX, contentOffY);
|
// window is shorter than the movie (same fix as HUD).
|
||||||
xPos += contentOffX;
|
if(!needsYTile && m_movieHeight > 0)
|
||||||
yPos += contentOffY;
|
{
|
||||||
ui.setupRenderPosition(xPos, yPos);
|
F32 scaleH = (F32)tileHeight / (F32)m_movieHeight;
|
||||||
|
if(scaleH < scale)
|
||||||
|
scale = scaleH;
|
||||||
|
}
|
||||||
|
|
||||||
|
IggyPlayerSetDisplaySize( getMovie(), (S32)(m_movieWidth * scale), (S32)(m_movieHeight * scale) );
|
||||||
|
|
||||||
IggyPlayerDrawTilesStart ( getMovie() );
|
IggyPlayerDrawTilesStart ( getMovie() );
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue