mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-01-09 02:21:30 +01:00
SynEdit: fix pixel to char, outside textarea
git-svn-id: trunk@53023 -
This commit is contained in:
parent
2cebdc3bf8
commit
2094de32dc
@ -1206,10 +1206,14 @@ function TLazSynTextArea.PixelsToRowColumn(Pixels: TPoint;
|
||||
aFlags: TSynCoordinateMappingFlags): TPoint;
|
||||
begin
|
||||
// Inludes LeftChar, but not Topline
|
||||
if not (scmForceLeftSidePos in aFlags) then
|
||||
Pixels.X := Pixels.X + (CharWidth div 2); // nearest side of char
|
||||
Result.X := (Pixels.X - FTextBounds.Left) div CharWidth
|
||||
+ LeftChar;
|
||||
if (Pixels.X >= FTextBounds.Left) and (Pixels.X < FTextBounds.Right) then begin
|
||||
if not (scmForceLeftSidePos in aFlags) then
|
||||
Pixels.X := Pixels.X + (CharWidth div 2); // nearest side of char
|
||||
Result.X := (Pixels.X - FTextBounds.Left) div CharWidth
|
||||
+ LeftChar;
|
||||
end
|
||||
else
|
||||
Result.X := 0;
|
||||
Result.Y := (Pixels.Y - FTextBounds.Top) div LineHeight;
|
||||
|
||||
if (not(scmIncludePartVisible in aFlags)) and (Result.Y >= LinesInWindow) then begin
|
||||
|
||||
Loading…
Reference in New Issue
Block a user