fix(style): use additive line_spacing model (font*1.1 + extra) instead of multiplicative
This commit is contained in:
@@ -56,7 +56,9 @@ impl StyleProfile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn line_height(&self) -> f32 {
|
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 {
|
pub fn apply_to_text(&self, text: &str) -> String {
|
||||||
|
|||||||
Reference in New Issue
Block a user