fix(chat): reaction pill emoji and faces centred
- Emoji line box shorter by twice the font's downward offset, so the glyph sits on the pill centre - Face ring 1 px, the avatar stack no longer sits low Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -24,8 +24,12 @@ const TAB_EMOJI_SIZE: f32 = 12.5;
24
24
const ENTRY_EMOJI_SIZE: f32 = 17.;
25
25
const PILL_TEXT_SIZE: f32 = 12.;
26
26
const PILL_GAP: f32 = 3.;
27
// Emoji fonts draw their glyphs below the centre of the line box: measured 0.5-1 px (Noto Color
28
// Emoji) and 1-2 px (Segoe UI Emoji) at 14 px. A line box shorter by twice the lift raises the
29
// baseline by the lift.
30
const EMOJI_LIFT: f32 = 0.07;
27
31
const FACE_SIZE: f32 = 18.;
28
const FACE_RING: f32 = 1.5;
32
const FACE_RING: f32 = 1.;
29
33
const FACE_OVERLAP: f32 = 6.;
30
34
const POPOVER_WIDTH: f32 = 290.;
31
35
const POPOVER_MAX_HEIGHT: f32 = 320.;
@@ -81,7 +85,7 @@ fn reaction_emoji(glyph: &str, label: &str, size: f32, directory: &Directory) ->
81
85
.h(px(size))
82
86
.text_size(px(size))
83
87
.font_family(theme::EMOJI_FONT_FAMILY)
84
.line_height(px(size))
88
.line_height(px(size - 2. * (size * EMOJI_LIFT).round()))
85
89
.child(label.to_owned())
86
90
.into_any_element();
87
91
};
@@ -24,8 +24,12 @@ const TAB_EMOJI_SIZE: f32 = 12.5;24
const ENTRY_EMOJI_SIZE: f32 = 17.;24
const ENTRY_EMOJI_SIZE: f32 = 17.;25
const PILL_TEXT_SIZE: f32 = 12.;25
const PILL_TEXT_SIZE: f32 = 12.;26
const PILL_GAP: f32 = 3.;26
const PILL_GAP: f32 = 3.;27
// Emoji fonts draw their glyphs below the centre of the line box: measured 0.5-1 px (Noto Color28
// Emoji) and 1-2 px (Segoe UI Emoji) at 14 px. A line box shorter by twice the lift raises the29
// baseline by the lift.30
const EMOJI_LIFT: f32 = 0.07;27
const FACE_SIZE: f32 = 18.;31
const FACE_SIZE: f32 = 18.;28
const FACE_RING: f32 = 1.5;32
const FACE_RING: f32 = 1.;29
const FACE_OVERLAP: f32 = 6.;33
const FACE_OVERLAP: f32 = 6.;30
const POPOVER_WIDTH: f32 = 290.;34
const POPOVER_WIDTH: f32 = 290.;31
const POPOVER_MAX_HEIGHT: f32 = 320.;35
const POPOVER_MAX_HEIGHT: f32 = 320.;@@ -81,7 +85,7 @@ fn reaction_emoji(glyph: &str, label: &str, size: f32, directory: &Directory) ->81
.h(px(size))85
.h(px(size))82
.text_size(px(size))86
.text_size(px(size))83
.font_family(theme::EMOJI_FONT_FAMILY)87
.font_family(theme::EMOJI_FONT_FAMILY)84
.line_height(px(size))88
.line_height(px(size - 2. * (size * EMOJI_LIFT).round()))85
.child(label.to_owned())89
.child(label.to_owned())86
.into_any_element();90
.into_any_element();87
};91
};