From cba5a69f07584e9aed2a8096b7a341622a581586 Mon Sep 17 00:00:00 2001 From: Tibor Nagy Date: Sun, 20 Sep 2020 21:45:21 +0200 Subject: [PATCH] FontEditor: Draw the baseline in the glyph editor widget --- Applications/FontEditor/FontEditor.cpp | 1 + Applications/FontEditor/GlyphEditorWidget.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Applications/FontEditor/FontEditor.cpp b/Applications/FontEditor/FontEditor.cpp index 3b07b270845..bf16c83312c 100644 --- a/Applications/FontEditor/FontEditor.cpp +++ b/Applications/FontEditor/FontEditor.cpp @@ -304,6 +304,7 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr&& edite baseline_spinbox.on_change = [this, update_demo](int value) { m_edited_font->set_baseline(value); + m_glyph_editor_widget->update(); update_demo(); }; diff --git a/Applications/FontEditor/GlyphEditorWidget.cpp b/Applications/FontEditor/GlyphEditorWidget.cpp index dc06a6a5e6c..32d4e08dca0 100644 --- a/Applications/FontEditor/GlyphEditorWidget.cpp +++ b/Applications/FontEditor/GlyphEditorWidget.cpp @@ -58,8 +58,10 @@ void GlyphEditorWidget::paint_event(GUI::PaintEvent& event) painter.translate(frame_thickness(), frame_thickness()); painter.translate(-1, -1); - for (int y = 1; y < font().glyph_height(); ++y) - painter.draw_line({ 0, y * m_scale }, { font().max_glyph_width() * m_scale, y * m_scale }, palette().threed_shadow2()); + for (int y = 1; y < font().glyph_height(); ++y) { + bool bold_line = (y - 1) == font().baseline(); + painter.draw_line({ 0, y * m_scale }, { font().max_glyph_width() * m_scale, y * m_scale }, palette().threed_shadow2(), bold_line ? 2 : 1); + } for (int x = 1; x < font().max_glyph_width(); ++x) painter.draw_line({ x * m_scale, 0 }, { x * m_scale, font().glyph_height() * m_scale }, palette().threed_shadow2());