Fix pr merge conflict

This commit is contained in:
KKNecmi 2026-03-13 18:07:04 +03:00
parent e0fcd8a9be
commit dc7ec02b54

View file

@ -68,9 +68,13 @@ void UIScene_HUD::updateSafeZone()
safeRight = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
safeBottom = getSafeZoneHalfHeight();
// safeTop mirrors SPLIT_TOP so both players have the same vertical inset
// from their viewport's top edge (split divider), keeping GUI symmetrical.
// safeBottom is intentionally omitted: it would shift m_Hud.y upward in
// ActionScript, placing the hotbar too high relative to SPLIT_TOP.
safeTop = getSafeZoneHalfHeight();
safeLeft = getSafeZoneHalfWidth();
safeRight = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
safeLeft = getSafeZoneHalfWidth();
@ -718,6 +722,20 @@ void UIScene_HUD::render(S32 width, S32 height, C4JRender::eViewportType viewpor
F32 scale;
ComputeTileScale(tileWidth, tileHeight, m_movieWidth, m_movieHeight, needsYTile, scale, tileYStart);
// For vertical split, if the window is shorter than the SWF movie,
// scale the movie down to fit the full height instead of cropping.
// ComputeTileScale clamps scale >= 1.0 (needed for quadrant mode),
// but in vertical split the tile covers the full screen height and
// cropping the bottom pushes RepositionHud's ActionScript to shift
// elements down. Scaling down keeps visibleH == movieHeight in SWF
// space, so ActionScript sees the full height and applies no offset.
if(!needsYTile && m_movieHeight > 0)
{
F32 scaleH = (F32)tileHeight / (F32)m_movieHeight;
if(scaleH < scale)
scale = scaleH;
}
IggyPlayerSetDisplaySize( getMovie(), static_cast<S32>(m_movieWidth * scale), static_cast<S32>(m_movieHeight * scale) );
repositionHud(tileWidth, tileHeight, scale);