Skip to content

Commit

Permalink
水平スクロール時に文字が欠ける問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
suconbu committed Jan 3, 2025
1 parent 53ea30b commit 1d3a15e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sakura_core/view/CTextDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,14 @@ 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;
while (nBeforeLogic < nLength) {
const CLayoutXInt nCharLayout = layoutMgr.GetLayoutXOfChar(pData, nLength, nBeforeLogic);
if (nLeftLayout < (nBeforeLayout + nCharLayout)) {
break;
}
nBeforeLayout += nCharLayout;
nBeforeLogic += CNativeW::GetSizeOfChar( pData, nLength, nBeforeLogic );
}
}
Expand Down

0 comments on commit 1d3a15e

Please sign in to comment.