Skip to content

Commit

Permalink
Merge pull request #1975 from suconbu/feature/fix_drawingerror_on_hsc…
Browse files Browse the repository at this point in the history
…roll

水平スクロール時に文字が欠ける問題を修正
  • Loading branch information
suconbu authored Jan 5, 2025
2 parents 53ea30b + 4ef8668 commit 1fcac94
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sakura_core/view/CTextDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ void CTextDrawer::DispText( HDC hdc, DispPos* pDispPos, int marginy, const wchar
int nBeforeLogic = 0;
CLayoutInt nBeforeLayout = CLayoutInt(0);
if ( x < 0 ){
int nLeftLayout = ( 0 - x ) / nDx - 1;
CLayoutMgr& layoutMgr = m_pEditView->m_pcEditDoc->m_cLayoutMgr;
while (nBeforeLayout < nLeftLayout){
nBeforeLayout += layoutMgr.GetLayoutXOfChar(pData, nLength, nBeforeLogic);
const CLayoutMgr& layoutMgr = m_pEditView->m_pcEditDoc->m_cLayoutMgr;
const int nLeftLayout = (0 - x) / nDx;
CLayoutXInt nCharLayout = layoutMgr.GetLayoutXOfChar(pData, nLength, nBeforeLogic);
while ((nBeforeLayout + nCharLayout) <= nLeftLayout) {
nBeforeLayout += nCharLayout;
nBeforeLogic += CNativeW::GetSizeOfChar( pData, nLength, nBeforeLogic );
nCharLayout = layoutMgr.GetLayoutXOfChar(pData, nLength, nBeforeLogic);
}
}

Expand Down

0 comments on commit 1fcac94

Please sign in to comment.