IDE, SynEdit: fix configuring column count for gutter-marks

This commit is contained in:
Martin 2024-03-13 22:47:38 +01:00
parent 46516b161f
commit 7400dc43b0
2 changed files with 5 additions and 2 deletions

View File

@ -32,7 +32,7 @@ type
function PaintMarks(aScreenLine: Integer; Canvas : TCanvas; AClip : TRect;
var aFirstCustomColumnIdx: integer): Boolean;
Procedure PaintLine(aScreenLine: Integer; Canvas : TCanvas; AClip : TRect); virtual;
property WantedColumns: integer read FWantedColumns;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;

View File

@ -2356,12 +2356,15 @@ end;
function TIDESynGutterMarks.PreferedWidthAtCurrentPPI: Integer;
var
img: TScaledImageListResolution;
c: Integer;
begin
if Assigned(SourceEditorMarks) and Assigned(SourceEditorMarks.ImgList) then
begin
c := WantedColumns;
if c <= 0 then c := 2;
img := GetImgListRes(nil, SourceEditorMarks.ImgList);
// + 1 => right margin
Result := img.Width * 2 + LeftMarginAtCurrentPPI + Scale96ToFont(1);
Result := img.Width * c + LeftMarginAtCurrentPPI + Scale96ToFont(1);
end else
Result := inherited PreferedWidthAtCurrentPPI;
end;