Fixed TextDiffCtrl font issue

git-svn-id: svn://ultimatepp.org/upp/trunk@15869 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2021-03-26 11:45:52 +00:00
parent 09cd37f0f9
commit 07a708bec6
3 changed files with 16 additions and 1 deletions

View file

@ -86,6 +86,12 @@ void TextCompareCtrl::MouseMove(Point pt, dword flags)
}
}
void TextCompareCtrl::LeftRepeat(Point pt, dword keyflags)
{
if(HasCapture() && !gutter_capture)
DoSelection(pt.y, true);
}
void TextCompareCtrl::LeftUp(Point pt, dword keyflags)
{
ReleaseCapture();
@ -128,6 +134,13 @@ bool TextCompareCtrl::Key(dword key, int repcnt)
{
Point pos = scroll, newpos = pos, page = scroll.GetPage();
switch(key) {
case K_CTRL_A:
if(lines.GetCount() > 1) {
cursor = lines[0].number;
anchor = lines.Top().number;
Refresh();
}
break;
case K_LEFT: newpos.x--; break;
case K_RIGHT: newpos.x++; break;
case K_CTRL_LEFT: newpos.x -= page.x >> 1; break;
@ -391,7 +404,7 @@ void TextCompareCtrl::SetFont(Font f, Font nf)
{
font = f;
number_font = nf;
letter.cy = f.GetHeight();
letter.cy = f.GetCy();
letter.cx = f.GetMonoWidth();
number_width = 5 * nf.GetMonoWidth();
number_yshift = (f.GetCy() - nf.GetCy() + 2) >> 1;