Skip to content

Commit

Permalink
Merge 60e290f into e34c4aa
Browse files Browse the repository at this point in the history
  • Loading branch information
beru authored Sep 5, 2020
2 parents e34c4aa + 60e290f commit 7f1713b
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions sakura_core/cmd/CViewCommander_Cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,11 +740,17 @@ void CViewCommander::Command_1PageUp( bool bSelect, CLayoutYInt nScrollNum )
if( nScrollNum <= 0 ){
nScrollNum = m_pCommanderView->GetTextArea().m_nViewRowNum - 1;
}
GetCaret().Cursor_UPDOWN( -nScrollNum, bSelect );
// Sep. 11, 2004 genta 同期スクロール処理のため
// m_pCommanderView->RedrawAllではなくScrollAtを使うように
m_pCommanderView->SyncScrollV( m_pCommanderView->ScrollAtV( nViewTopLine - nScrollNum ));
auto& caret = GetCaret();
auto prevCaretPos = caret.GetCaretLayoutPos();
caret.Cursor_UPDOWN( -nScrollNum, bSelect );
auto currCaretPos = caret.GetCaretLayoutPos();
CLayoutInt nScrolled = m_pCommanderView->ScrollAtV( nViewTopLine - nScrollNum );
m_pCommanderView->SyncScrollV(nScrolled);
m_pCommanderView->SetDrawSwitch(bDrawSwitchOld);
// カーソル位置が変化しなかった、かつ、スクロール行数が0だった場合、描画を省く
if (prevCaretPos == currCaretPos && nScrolled == 0) {
return;
}
m_pCommanderView->RedrawAll();
}
return;
Expand All @@ -769,11 +775,17 @@ void CViewCommander::Command_1PageDown( bool bSelect, CLayoutYInt nScrollNum )
if( nScrollNum <= 0 ){
nScrollNum = m_pCommanderView->GetTextArea().m_nViewRowNum - 1;
}
GetCaret().Cursor_UPDOWN( nScrollNum, bSelect );
// Sep. 11, 2004 genta 同期スクロール処理のため
// m_pCommanderView->RedrawAllではなくScrollAtを使うように
m_pCommanderView->SyncScrollV( m_pCommanderView->ScrollAtV( nViewTopLine + nScrollNum ));
auto& caret = GetCaret();
auto prevCaretPos = caret.GetCaretLayoutPos();
caret.Cursor_UPDOWN( nScrollNum, bSelect );
auto currCaretPos = caret.GetCaretLayoutPos();
CLayoutInt nScrolled = m_pCommanderView->ScrollAtV( nViewTopLine + nScrollNum );
m_pCommanderView->SyncScrollV(nScrolled);
m_pCommanderView->SetDrawSwitch(bDrawSwitchOld);
// カーソル位置が変化しなかった、かつ、スクロール行数が0だった場合、描画を省く
if (prevCaretPos == currCaretPos && nScrolled == 0) {
return;
}
m_pCommanderView->RedrawAll();
}

Expand Down

0 comments on commit 7f1713b

Please sign in to comment.