fix: reduce alarm snapshot label obstruction

This commit is contained in:
2026-06-15 14:21:31 +08:00
parent fa2c90e250
commit 7b9ec2e148
3 changed files with 50 additions and 6 deletions

View File

@@ -189,6 +189,25 @@ class AlarmSnapshotTests(unittest.TestCase):
dockerfile = (Path(__file__).resolve().parents[1] / "Dockerfile").read_text(encoding="utf-8")
self.assertIn("fonts-noto-cjk", dockerfile)
def test_drawtext_label_style_stays_small_and_translucent(self) -> None:
filter_text = alarm_snapshots.build_drawtext_filter(
[
alarm_snapshots.OverlayLabel(
text="区域 1",
fallback_text="R1",
x=10,
y=20,
accent_rgb=(255, 196, 0),
)
],
Path("/tmp/NotoSansCJK-Regular.ttc"),
height=360,
)
self.assertIn("fontsize=13", filter_text)
self.assertIn("boxcolor=black@0.34", filter_text)
self.assertIn("boxborderw=2", filter_text)
def test_capture_alert_snapshot_encodes_frame_with_configured_calibration_overlay(self) -> None:
encoded_frames: list[Frame] = []