|
|
|
@ -4,7 +4,7 @@ from dataclasses import dataclass |
|
|
|
|
from collections.abc import Callable |
|
|
|
|
from cereal import log |
|
|
|
|
from openpilot.selfdrive.ui.ui_state import ui_state |
|
|
|
|
from openpilot.system.ui.lib.application import gui_app, FontWeight, MousePos |
|
|
|
|
from openpilot.system.ui.lib.application import gui_app, FontWeight, MousePos, FONT_SCALE |
|
|
|
|
from openpilot.system.ui.lib.text_measure import measure_text_cached |
|
|
|
|
from openpilot.system.ui.widgets import Widget |
|
|
|
|
|
|
|
|
@ -218,7 +218,7 @@ class Sidebar(Widget): |
|
|
|
|
|
|
|
|
|
# Draw label and value |
|
|
|
|
labels = [metric.label, metric.value] |
|
|
|
|
text_y = metric_rect.y + (metric_rect.height / 2 - len(labels) * FONT_SIZE) |
|
|
|
|
text_y = metric_rect.y + (metric_rect.height / 2 - len(labels) * FONT_SIZE * FONT_SCALE) |
|
|
|
|
for text in labels: |
|
|
|
|
text_size = measure_text_cached(self._font_bold, text, FONT_SIZE) |
|
|
|
|
text_y += text_size.y |
|
|
|
|