Skip to content

Commit

Permalink
Caret (text cursor) follow windows settings (#2534) (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Nov 11, 2024
1 parent ab1b1f7 commit 1b2db57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Externals/crystaledit/editlib/ccrystaltextview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2871,9 +2871,11 @@ UpdateCaret ()
}
else
{
DWORD caretWidth = 2;
DWORD caretWidth = 1;
SystemParametersInfo (SPI_GETCARETWIDTH, 0, &caretWidth, 0);
CreateSolidCaret (caretWidth, nCaretHeight);
const int dpi = CClientDC (this).GetDeviceCaps (LOGPIXELSX);
const int nCaretWidth = MulDiv (caretWidth, dpi, 96);
CreateSolidCaret (nCaretWidth, nCaretHeight);
}

SetCaretPos (TextToClient (m_ptCursorPos));
Expand Down

0 comments on commit 1b2db57

Please sign in to comment.