raylib: fix emoji vertical centering (#36358)

* space

* font scale

* fix centering
This commit is contained in:
Shane Smiskol
2025-10-15 00:06:04 -07:00
committed by GitHub
parent 75858673c4
commit 3e56612990
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ class SetupWidget(Widget):
self._pair_device_btn = Button("Pair device", self._show_pairing, button_style=ButtonStyle.PRIMARY)
self._open_settings_btn = Button("Open", lambda: self._open_settings_callback() if self._open_settings_callback else None,
button_style=ButtonStyle.PRIMARY)
self._firehose_label = Label("🔥Firehose Mode 🔥", font_weight=FontWeight.MEDIUM, font_size=64)
self._firehose_label = Label("🔥 Firehose Mode 🔥", font_weight=FontWeight.MEDIUM, font_size=64)
def set_open_settings_callback(self, callback):
self._open_settings_callback = callback
@@ -65,7 +65,7 @@ class SetupWidget(Widget):
# Title with fire emojis
# TODO: fix Label centering with emojis
self._firehose_label.render(rl.Rectangle(x - 40, y, w, 64))
self._firehose_label.render(rl.Rectangle(x - 48, y, w, 64))
y += 64 + spacing
# Description
+1 -1
View File
@@ -170,7 +170,7 @@ class Label(Widget):
line_pos.x += width_before.x
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 * FONT_SCALE, self._text_color)
line_pos.x += self._font_size * FONT_SCALE
prev_index = end
rl.draw_text_ex(self._font, text[prev_index:], line_pos, self._font_size, 0, self._text_color)