FontEditor: Update the glyph map when changing a glyph's width.

This commit is contained in:
Andreas Kling 2019-04-10 04:02:20 +02:00
commit b980c32662
Notes: sideshowbarker 2024-07-19 14:46:40 +09:00
2 changed files with 3 additions and 4 deletions

View file

@ -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) {