1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00

FontEditor: Don't crash when clicking on the unused part of a glyph.

This commit is contained in:
Andreas Kling 2019-03-06 19:04:30 +01:00
parent 31d6b640eb
commit b46c7da0a4

View file

@ -269,8 +269,10 @@ void GlyphEditorWidget::draw_at_mouse(const GMouseEvent& event)
int x = (event.x() - 1) / m_scale;
int y = (event.y() - 1) / m_scale;
auto bitmap = font().glyph_bitmap(m_glyph);
ASSERT(x < bitmap.width());
ASSERT(y < bitmap.height());
if (x >= bitmap.width())
return;
if (y >= bitmap.height())
return;
if (bitmap.bit_at(x, y) == set)
return;
bitmap.set_bit_at(x, y, set);