From f21e9d5f8942250546221a0371e2c1b4c6b6729f Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Sun, 30 Aug 2026 18:41:19 +0700 Subject: [PATCH] [saco] Match `CDXUTIMEEditBox::RenderCandidateReadingWindow`; retail has no bottom/top/right/left fitting --- saco/d3d9/common/DXUTgui.cpp | 52 ------------------------------------ 1 file changed, 52 deletions(-) diff --git a/saco/d3d9/common/DXUTgui.cpp b/saco/d3d9/common/DXUTgui.cpp index 7d75df4..808ebd6 100644 --- a/saco/d3d9/common/DXUTgui.cpp +++ b/saco/d3d9/common/DXUTgui.cpp @@ -7077,12 +7077,6 @@ void CDXUTIMEEditBox::RenderCandidateReadingWindow( IDirect3DDevice9* pd3dDevice } // Now that we have the dimension, calculate the location for the candidate window. - // We attempt to fit the window in this order: - // bottom, top, right, left. - - bool bHasPosition = false; - - // Bottom SetRect( &rc, s_ptCompString.x + nXComp, s_ptCompString.y + m_rcText.bottom - m_rcText.top, s_ptCompString.x + nXComp + nWidthRequired, s_ptCompString.y + m_rcText.bottom - m_rcText.top + nHeightRequired ); // if the right edge is cut off, move it left. @@ -7091,52 +7085,6 @@ void CDXUTIMEEditBox::RenderCandidateReadingWindow( IDirect3DDevice9* pd3dDevice rc.left -= rc.right - m_pDialog->GetWidth(); rc.right = m_pDialog->GetWidth(); } - if( rc.bottom <= m_pDialog->GetHeight() ) - bHasPosition = true; - - // Top - if( !bHasPosition ) - { - SetRect( &rc, s_ptCompString.x + nXComp, s_ptCompString.y - nHeightRequired, - s_ptCompString.x + nXComp + nWidthRequired, s_ptCompString.y ); - // if the right edge is cut off, move it left. - if( rc.right > m_pDialog->GetWidth() ) - { - rc.left -= rc.right - m_pDialog->GetWidth(); - rc.right = m_pDialog->GetWidth(); - } - if( rc.top >= 0 ) - bHasPosition = true; - } - - // Right - if( !bHasPosition ) - { - int nXCompTrail; - s_CompString.CPtoX( s_nCompCaret, TRUE, &nXCompTrail ); - SetRect( &rc, s_ptCompString.x + nXCompTrail, 0, - s_ptCompString.x + nXCompTrail + nWidthRequired, nHeightRequired ); - if( rc.right <= m_pDialog->GetWidth() ) - bHasPosition = true; - } - - // Left - if( !bHasPosition ) - { - SetRect( &rc, s_ptCompString.x + nXComp - nWidthRequired, 0, - s_ptCompString.x + nXComp, nHeightRequired ); - if( rc.right >= 0 ) - bHasPosition = true; - } - - if( !bHasPosition ) - { - // The dialog is too small for the candidate window. - // Fall back to render at 0, 0. Some part of the window - // will be cut off. - rc.left = 0; - rc.right = nWidthRequired; - } // If we are rendering the candidate window, save the position // so that mouse clicks are checked properly.