From f56afc52c518faba444d21c23e1b24657a3b3ec6 Mon Sep 17 00:00:00 2001 From: Alexey Date: Thu, 25 Apr 2024 20:50:45 +0300 Subject: [PATCH] better calc NRectHeight for micromap, #5493 --- app/proc_editor_micromap.pas | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/proc_editor_micromap.pas b/app/proc_editor_micromap.pas index c8de690fcda..3e5947ab74c 100644 --- a/app/proc_editor_micromap.pas +++ b/app/proc_editor_micromap.pas @@ -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