From fd85b532eed2db1dcd9693dfb8711e096b89b072 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 23 Jun 2026 21:04:44 +0300 Subject: [PATCH] fix: ruler text scales with DPI (font height tied to ruler height) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ruler drew labels at a fixed Font.Size := 7, so on Windows display scaling (125/150/200%) the text no longer matched the DPI-scaled ruler height — labels came out too small or clipped. Tie the font height to the ruler height (-Max(8, Round(H*0.45))) so labels scale with DPI, matching the approach used by the new bandplan overlay. Co-Authored-By: Claude Opus 4.8 --- RulerView.pas | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RulerView.pas b/RulerView.pas index bc32868..5980f37 100644 --- a/RulerView.pas +++ b/RulerView.pas @@ -177,7 +177,11 @@ begin C.Pen.Color := FTheme.RulerBorder; C.Pen.Width := 1; C.MoveTo(0, 0); C.LineTo(W, 0); C.MoveTo(0, H-1); C.LineTo(W, H-1); - C.Font.Name := 'Courier New'; C.Font.Size := 7; + // Высота шрифта привязана к высоте линейки (H уже DPI-масштабирована в MainForm), + // а не к point-size — иначе на Windows-масштабе 125/150/200% текст не совпадал с + // высотой полосы (метки мелкие/обрезались). Теперь шрифт скейлится вместе с DPI. + C.Font.Name := 'Courier New'; C.Font.Style := []; + C.Font.Height := -Max(8, Round(H * 0.45)); C.Brush.Style := bsClear; FreqStart := FCenterFreq - FSpanHz / 2; if FFMGridStepHz > 0 then