fix label line height

pull/36306/head
Shane Smiskol 6 days ago
parent b67cb802b6
commit efda5b4f3b
  1. 6
      system/ui/widgets/label.py

@ -3,7 +3,7 @@ from itertools import zip_longest
import pyray as rl import pyray as rl
from openpilot.system.ui.lib.application import gui_app, FontWeight, DEFAULT_TEXT_SIZE, DEFAULT_TEXT_COLOR from openpilot.system.ui.lib.application import gui_app, FontWeight, DEFAULT_TEXT_SIZE, DEFAULT_TEXT_COLOR, FONT_SCALE
from openpilot.system.ui.lib.text_measure import measure_text_cached from openpilot.system.ui.lib.text_measure import measure_text_cached
from openpilot.system.ui.lib.utils import GuiStyleContext from openpilot.system.ui.lib.utils import GuiStyleContext
from openpilot.system.ui.lib.emoji import find_emoji, emoji_tex from openpilot.system.ui.lib.emoji import find_emoji, emoji_tex
@ -171,7 +171,7 @@ class Label(Widget):
tex = emoji_tex(emoji) tex = emoji_tex(emoji)
rl.draw_texture_ex(tex, line_pos, 0.0, self._font_size / tex.height, self._text_color) rl.draw_texture_ex(tex, line_pos, 0.0, self._font_size / tex.height, self._text_color)
line_pos.x += self._font_size line_pos.x += self._font_size * FONT_SCALE
prev_index = end prev_index = end
rl.draw_text_ex(self._font, text[prev_index:], line_pos, self._font_size, 0, self._text_color) rl.draw_text_ex(self._font, text[prev_index:], line_pos, self._font_size, 0, self._text_color)
text_pos.y += text_size.y or self._font_size text_pos.y += text_size.y or self._font_size * FONT_SCALE

Loading…
Cancel
Save