From dc7ec02b5400b0cfc826ee4ecf01f054ef529d35 Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Fri, 13 Mar 2026 18:07:04 +0300 Subject: [PATCH] Fix pr merge conflict --- Minecraft.Client/Common/UI/UIScene_HUD.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIScene_HUD.cpp b/Minecraft.Client/Common/UI/UIScene_HUD.cpp index 631f93319..24b3e827e 100644 --- a/Minecraft.Client/Common/UI/UIScene_HUD.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HUD.cpp @@ -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(m_movieWidth * scale), static_cast(m_movieHeight * scale) ); repositionHud(tileWidth, tileHeight, scale);