Skip to content

Commit

Permalink
better calc NRectHeight for micromap, #5493
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Apr 25, 2024
1 parent 4400bca commit f56afc5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/proc_editor_micromap.pas
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,10 @@ procedure EditorPaintMicromap(Ed: TATSynEdit; ACanvas: TCanvas; const ARect: TRe
if Ed.OptLastLineOnTop then
NScaleDiv:= Max(1, NScaleDiv+Ed.GetVisibleLines-1);

//this calc of NRectHeight is incorrect in general case;
//it makes gap at the bottom, when count of lines is from ~1000 to some big value (10k?);
//but gap is absent for small count of lines and for very big doc
NRectHeight:= ARect.Height;
if Ed.GetVisibleLines * NRectHeight div NScaleDiv < UiOps.MicromapMinViewareaHeight then
Dec(NRectHeight, UiOps.MicromapMinViewareaHeight-1);
i:= Ed.GetVisibleLines * NRectHeight div NScaleDiv;
if i < UiOps.MicromapMinViewareaHeight then
Dec(NRectHeight, UiOps.MicromapMinViewareaHeight-1-i);
NRectHeight:= Max(1, NRectHeight);

//NWidthSmall:= Ed.TextCharSize.XScaled div 2 div ATEditorCharXScale; //50% of char width
Expand Down

0 comments on commit f56afc5

Please sign in to comment.