mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 16:19:13 +02:00
SynEdit: use font height instead of size for zooming
git-svn-id: trunk@34014 -
This commit is contained in:
parent
d280484b66
commit
9657e3c841
@ -1827,7 +1827,7 @@ begin
|
||||
fFontDummy.Height := SynDefaultFontHeight;
|
||||
fFontDummy.Pitch := SynDefaultFontPitch;
|
||||
fFontDummy.Quality := SynDefaultFontQuality;
|
||||
FLastSetFontSize := fFontDummy.Size;
|
||||
FLastSetFontSize := fFontDummy.Height;
|
||||
fLastMouseCaret := Point(-1,-1);
|
||||
FLastMousePoint := Point(-1,-1);
|
||||
fBlockIndent := 2;
|
||||
@ -2149,7 +2149,7 @@ end;
|
||||
|
||||
procedure TCustomSynEdit.FontChanged(Sender: TObject);
|
||||
begin
|
||||
FLastSetFontSize := Font.Size;
|
||||
FLastSetFontSize := Font.Height;
|
||||
RecalcCharExtent;
|
||||
SizeOrFontChanged(TRUE);
|
||||
end;
|
||||
@ -2833,8 +2833,8 @@ begin
|
||||
end;
|
||||
emcWheelZoomOut, emcWheelZoomIn:
|
||||
begin
|
||||
if ( (ACommand = emcWheelZoomOut) and (abs(Font.Size) < 3) ) or
|
||||
( (ACommand = emcWheelZoomIn) and (abs(Font.Size) > 50) )
|
||||
if ( (ACommand = emcWheelZoomOut) and (abs(Font.Height) < 3) ) or
|
||||
( (ACommand = emcWheelZoomIn) and (abs(Font.Height) > 50) )
|
||||
then begin
|
||||
Result := False;
|
||||
end
|
||||
@ -2842,15 +2842,15 @@ begin
|
||||
j := 1;
|
||||
if ACommand = emcWheelZoomIn then j := -1;
|
||||
i := FLastSetFontSize;
|
||||
if Font.Size < 0
|
||||
then Font.Size := Font.Size + j
|
||||
else Font.Size := Font.Size - j;
|
||||
if Font.Height < 0
|
||||
then Font.Height := Font.Height + j
|
||||
else Font.Height := Font.Height - j;
|
||||
FLastSetFontSize := i;
|
||||
end;
|
||||
end;
|
||||
emcWheelZoomNorm:
|
||||
begin
|
||||
Font.Size := FLastSetFontSize;
|
||||
Font.Height := FLastSetFontSize;
|
||||
end;
|
||||
else
|
||||
Result := False; // ACommand was not handled => Fallback to parent Context
|
||||
|
Loading…
Reference in New Issue
Block a user