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

FontEditor: Set all pixels when pasting a glyph

For an empty glyph (all pixels initially clear), this makes no
difference. However, if the glyph for the selected code point already
contains some set pixels, pasting used to "add" the set pixels, instead
of overwriting.
This commit is contained in:
Ben Wiederhake 2021-11-20 03:10:34 +01:00 committed by Andreas Kling
parent 8d80d1346d
commit 63078ba7fc

View file

@ -107,8 +107,7 @@ void GlyphEditorWidget::paste_glyph()
auto bitmap = font().raw_glyph(m_glyph).glyph_bitmap();
for (int x = 0; x < min(bitmap.width(), buffer_width.value()); x++) {
for (int y = 0; y < min(bitmap.height(), buffer_height.value()); y++) {
if (bits[x][y])
bitmap.set_bit_at(x, y, bits[x][y]);
bitmap.set_bit_at(x, y, bits[x][y]);
}
}