mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 16:59:11 +02:00
SynEdit: Change CaretXPix/YPix to use ScreenXYToPixels, TextXYToScreenXY
git-svn-id: trunk@63271 -
This commit is contained in:
parent
253d7c2d02
commit
9566494312
@ -2852,13 +2852,18 @@ function TCustomSynEdit.CaretXPix: Integer;
|
|||||||
var
|
var
|
||||||
p: TPoint;
|
p: TPoint;
|
||||||
begin
|
begin
|
||||||
p := Point(CaretX, CaretY);
|
p := FCaret.ViewedLineCharPos;
|
||||||
Result := RowColumnToPixels(p).X;
|
p.y := p.y - TopView + 1;
|
||||||
|
Result := ScreenXYToPixels(p).X;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomSynEdit.CaretYPix: Integer;
|
function TCustomSynEdit.CaretYPix: Integer;
|
||||||
|
var
|
||||||
|
p: TPoint;
|
||||||
begin
|
begin
|
||||||
Result := RowColumnToPixels(Point(1, CaretY)).Y;
|
p := FCaret.ViewedLineCharPos;
|
||||||
|
p.y := p.y - TopView + 1;
|
||||||
|
Result := ScreenXYToPixels(p).Y;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomSynEdit.FontChanged(Sender: TObject);
|
procedure TCustomSynEdit.FontChanged(Sender: TObject);
|
||||||
@ -5049,7 +5054,7 @@ end;
|
|||||||
|
|
||||||
procedure TCustomSynEdit.UpdateCaret(IgnorePaintLock: Boolean = False);
|
procedure TCustomSynEdit.UpdateCaret(IgnorePaintLock: Boolean = False);
|
||||||
var
|
var
|
||||||
x, y: Integer;
|
p: TPoint;
|
||||||
begin
|
begin
|
||||||
if ( (PaintLock <> 0) and not IgnorePaintLock ) or (not HandleAllocated)
|
if ( (PaintLock <> 0) and not IgnorePaintLock ) or (not HandleAllocated)
|
||||||
then begin
|
then begin
|
||||||
@ -5059,9 +5064,9 @@ begin
|
|||||||
if eoAlwaysVisibleCaret in fOptions2 then
|
if eoAlwaysVisibleCaret in fOptions2 then
|
||||||
MoveCaretToVisibleArea;
|
MoveCaretToVisibleArea;
|
||||||
|
|
||||||
x := CaretXPix;
|
p := FCaret.ViewedLineCharPos;
|
||||||
y := CaretYPix;
|
p.y := p.y - TopView + 1;
|
||||||
FScreenCaret.DisplayPos := Point(x, y);
|
FScreenCaret.DisplayPos := ScreenXYToPixels(p);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user