FontEditor: Set correct mean- and baseline ranges for new fonts

Fixes out-of-bounds lines in glyph editor
This commit is contained in:
thankyouverycool 2021-04-22 14:20:57 -04:00 committed by Andreas Kling
parent bada590b91
commit 8b3a92de37
2 changed files with 3 additions and 2 deletions

View file

@ -442,6 +442,9 @@ void FontEditorWidget::initialize(const String& path, RefPtr<Gfx::BitmapFont>&&
m_presentation_spinbox->set_value(m_edited_font->presentation_size());
m_spacing_spinbox->set_value(m_edited_font->glyph_spacing());
m_mean_line_spinbox->set_range(0, max(m_edited_font->glyph_height() - 2, 0), false);
m_baseline_spinbox->set_range(0, max(m_edited_font->glyph_height() - 2, 0), false);
m_mean_line_spinbox->set_value(m_edited_font->mean_line());
m_baseline_spinbox->set_value(m_edited_font->baseline());

View file

@ -175,7 +175,6 @@
@GUI::SpinBox {
name: "mean_line_spinbox"
min: 0
max: 32
}
}
@ -193,7 +192,6 @@
@GUI::SpinBox {
name: "baseline_spinbox"
min: 0
max: 32
}
}