diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2020-08-29 12:00:06 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-30 10:31:04 +0200 |
commit | 61521315ed41e2659ec9252a9e636f487ab1e297 (patch) | |
tree | 0e2756753599904a4fb2cc0173310536af15530f /Applications | |
parent | b742d593dd60c6e14a3e171d4c9765a231f6ab7e (diff) | |
download | serenity-61521315ed41e2659ec9252a9e636f487ab1e297.zip |
FontEditor: Enforce boundaries of GlyphEditorWidget
Drawing out of bounds no longer affects any neighboring glyphs.
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/FontEditor/GlyphEditorWidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Applications/FontEditor/GlyphEditorWidget.cpp b/Applications/FontEditor/GlyphEditorWidget.cpp index d1fcb13dd1..dc06a6a5e6 100644 --- a/Applications/FontEditor/GlyphEditorWidget.cpp +++ b/Applications/FontEditor/GlyphEditorWidget.cpp @@ -99,9 +99,9 @@ void GlyphEditorWidget::draw_at_mouse(const GUI::MouseEvent& event) int x = (event.x() - 1) / m_scale; int y = (event.y() - 1) / m_scale; auto bitmap = font().glyph_bitmap(m_glyph); - if (x >= bitmap.width()) + if (x < 0 || x >= bitmap.width()) return; - if (y >= bitmap.height()) + if (y < 0 || y >= bitmap.height()) return; if (bitmap.bit_at(x, y) == set) return; |