mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
FontEditor: Enforce boundaries of GlyphEditorWidget
Drawing out of bounds no longer affects any neighboring glyphs.
This commit is contained in:
parent
b742d593dd
commit
61521315ed
Notes:
sideshowbarker
2024-07-19 03:01:01 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/61521315ed4 Pull-request: https://github.com/SerenityOS/serenity/pull/3343 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/tomuta
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue