Fully revert the line height change

This commit is contained in:
Kirill Bulatov 2023-07-20 15:39:22 +03:00
parent 0e6048a85d
commit 0237276557
2 changed files with 3 additions and 13 deletions

View file

@ -1300,7 +1300,7 @@ impl Editor {
let editor_view_id = cx.view_id(); let editor_view_id = cx.view_id();
let display_map = cx.add_model(|cx| { let display_map = cx.add_model(|cx| {
let settings = settings::get::<ThemeSettings>(cx); let settings = settings::get::<ThemeSettings>(cx);
let style = build_style(settings, get_field_editor_theme.as_deref(), None, &mode, cx); let style = build_style(settings, get_field_editor_theme.as_deref(), None, cx);
DisplayMap::new( DisplayMap::new(
buffer.clone(), buffer.clone(),
style.text.font_id, style.text.font_id,
@ -1500,7 +1500,6 @@ impl Editor {
settings::get::<ThemeSettings>(cx), settings::get::<ThemeSettings>(cx),
self.get_field_editor_theme.as_deref(), self.get_field_editor_theme.as_deref(),
self.override_text_style.as_deref(), self.override_text_style.as_deref(),
&self.mode,
cx, cx,
) )
} }
@ -8153,11 +8152,10 @@ fn build_style(
settings: &ThemeSettings, settings: &ThemeSettings,
get_field_editor_theme: Option<&GetFieldEditorTheme>, get_field_editor_theme: Option<&GetFieldEditorTheme>,
override_text_style: Option<&OverrideTextStyle>, override_text_style: Option<&OverrideTextStyle>,
mode: &EditorMode,
cx: &AppContext, cx: &AppContext,
) -> EditorStyle { ) -> EditorStyle {
let font_cache = cx.font_cache(); let font_cache = cx.font_cache();
let mut line_height_scalar = settings.line_height(); let line_height_scalar = settings.line_height();
let theme_id = settings.theme.meta.id; let theme_id = settings.theme.meta.id;
let mut theme = settings.theme.editor.clone(); let mut theme = settings.theme.editor.clone();
let mut style = if let Some(get_field_editor_theme) = get_field_editor_theme { let mut style = if let Some(get_field_editor_theme) = get_field_editor_theme {
@ -8168,14 +8166,6 @@ fn build_style(
.container .container
.background_color .background_color
.unwrap_or_default(); .unwrap_or_default();
line_height_scalar = match mode {
EditorMode::SingleLine | EditorMode::Full => line_height_scalar,
EditorMode::AutoHeight { .. } => cx
.font_cache()
.line_height(field_editor_theme.text.font_size),
};
EditorStyle { EditorStyle {
text: field_editor_theme.text, text: field_editor_theme.text,
placeholder_text: field_editor_theme.placeholder_text, placeholder_text: field_editor_theme.placeholder_text,

View file

@ -13,7 +13,7 @@ use std::sync::Arc;
use util::ResultExt as _; use util::ResultExt as _;
const MIN_FONT_SIZE: f32 = 6.0; const MIN_FONT_SIZE: f32 = 6.0;
const MIN_LINE_HEIGHT: f32 = 1.1; const MIN_LINE_HEIGHT: f32 = 1.0;
#[derive(Clone, JsonSchema)] #[derive(Clone, JsonSchema)]
pub struct ThemeSettings { pub struct ThemeSettings {