fix(style): use additive line_spacing model (font*1.1 + extra) instead of multiplicative

This commit is contained in:
Developer
2026-05-15 23:21:45 +08:00
parent 31efa90a87
commit 006cb3cd5e

View File

@@ -56,7 +56,9 @@ impl StyleProfile {
}
pub fn line_height(&self) -> f32 {
self.font_size * self.line_spacing
// egui actual line height is approximately font_size * 1.1
// line_spacing adds extra (line_spacing - 1.0) * font_size * 0.5 as extra gap
self.font_size * 1.1 + self.font_size * (self.line_spacing - 1.0).max(0.0) * 0.5
}
pub fn apply_to_text(&self, text: &str) -> String {