mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 18:43:51 +00:00
fix: ruler text scales with DPI (font height tied to ruler height)
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 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user