diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-10 04:02:20 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-10 04:02:20 +0200 |
commit | b980c3266250c059c84a2e13343ebc508020bc25 (patch) | |
tree | 9becaaa0b030049aa7ce2338476bbea5be4a9940 /Applications | |
parent | f5c295ecc595cd03584caa26d4cc26f4ad39fc4f (diff) | |
download | serenity-b980c3266250c059c84a2e13343ebc508020bc25.zip |
FontEditor: Update the glyph map when changing a glyph's width.
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/FontEditor/FontEditor.cpp | 1 | ||||
-rw-r--r-- | Applications/FontEditor/GlyphMapWidget.cpp | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/Applications/FontEditor/FontEditor.cpp b/Applications/FontEditor/FontEditor.cpp index 18e66a8ae7..1ebedb37a9 100644 --- a/Applications/FontEditor/FontEditor.cpp +++ b/Applications/FontEditor/FontEditor.cpp @@ -108,6 +108,7 @@ FontEditorWidget::FontEditorWidget(const String& path, RetainPtr<Font>&& edited_ width_spinbox->on_change = [this, update_demo] (int value) { m_edited_font->set_glyph_width(m_glyph_map_widget->selected_glyph(), value); m_glyph_editor_widget->update(); + m_glyph_map_widget->update_glyph(m_glyph_map_widget->selected_glyph()); update_demo(); }; diff --git a/Applications/FontEditor/GlyphMapWidget.cpp b/Applications/FontEditor/GlyphMapWidget.cpp index 2be8c37e63..de45591036 100644 --- a/Applications/FontEditor/GlyphMapWidget.cpp +++ b/Applications/FontEditor/GlyphMapWidget.cpp @@ -39,12 +39,12 @@ Rect GlyphMapWidget::get_outer_rect(byte glyph) const { int row = glyph / columns(); int column = glyph % columns(); - return { + return Rect { column * (font().max_glyph_width() + m_horizontal_spacing) + 1, row * (font().glyph_height() + m_vertical_spacing) + 1, font().max_glyph_width() + m_horizontal_spacing, font().glyph_height() + m_horizontal_spacing - }; + }.translated(frame_thickness(), frame_thickness()); } void GlyphMapWidget::update_glyph(byte glyph) @@ -62,8 +62,6 @@ void GlyphMapWidget::paint_event(GPaintEvent& event) painter.set_font(font()); painter.fill_rect(frame_inner_rect(), Color::White); - painter.translate(frame_thickness(), frame_thickness()); - byte glyph = 0; for (int row = 0; row < rows(); ++row) { |