mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 02:49:19 +02:00
SynEdit: Improve boundary checks in MouseMove (while drag or select). Remove some obsolete checks.
This commit is contained in:
parent
bc2d68125a
commit
ebf6768e85
@ -3855,6 +3855,13 @@ begin
|
|||||||
//DebugLn(' TCustomSynEdit.MouseMove CAPTURE Mouse=',dbgs(X),',',dbgs(Y),' Caret=',dbgs(CaretXY),', BlockBegin=',dbgs(BlockBegin),' BlockEnd=',dbgs(BlockEnd));
|
//DebugLn(' TCustomSynEdit.MouseMove CAPTURE Mouse=',dbgs(X),',',dbgs(Y),' Caret=',dbgs(CaretXY),', BlockBegin=',dbgs(BlockBegin),' BlockEnd=',dbgs(BlockEnd));
|
||||||
if sfIsDragging in fStateFlags then
|
if sfIsDragging in fStateFlags then
|
||||||
FBlockSelection.IncPersistentLock;
|
FBlockSelection.IncPersistentLock;
|
||||||
|
|
||||||
|
// compare to Bounds => Padding area does not scroll
|
||||||
|
if (X >= FTextArea.Bounds.Left) and
|
||||||
|
(X < FTextArea.Bounds.Right) and
|
||||||
|
(Y >= FTextArea.Bounds.Top) and
|
||||||
|
(Y < FTextArea.Bounds.Bottom)
|
||||||
|
then begin
|
||||||
FInternalCaret.AssignFrom(FCaret);
|
FInternalCaret.AssignFrom(FCaret);
|
||||||
FInternalCaret.LineCharPos := PixelsToRowColumn(Point(X,Y));
|
FInternalCaret.LineCharPos := PixelsToRowColumn(Point(X,Y));
|
||||||
|
|
||||||
@ -3896,12 +3903,6 @@ begin
|
|||||||
FInternalCaret.LineBytePos := p1;
|
FInternalCaret.LineBytePos := p1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// compare to Bounds => Padding area does not scroll
|
|
||||||
if ( (X >= FTextArea.Bounds.Left) or (LeftChar <= 1) ) and
|
|
||||||
( (X < FTextArea.Bounds.Right) or (LeftChar >= CurrentMaxLeftChar) ) and
|
|
||||||
( (Y >= FTextArea.Bounds.Top) or (TopView <= 1) ) and
|
|
||||||
( (Y < FTextArea.Bounds.Bottom) or (TopView >= CurrentMaxTopView) )
|
|
||||||
then begin
|
|
||||||
if (sfMouseSelecting in fStateFlags) and not FInternalCaret.IsAtPos(FCaret) then
|
if (sfMouseSelecting in fStateFlags) and not FInternalCaret.IsAtPos(FCaret) then
|
||||||
Include(fStateFlags, sfMouseDoneSelecting);
|
Include(fStateFlags, sfMouseDoneSelecting);
|
||||||
FBlockSelection.StickyAutoExtend := False;
|
FBlockSelection.StickyAutoExtend := False;
|
||||||
|
Loading…
Reference in New Issue
Block a user