mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 07:07:34 +00:00
FontEditor: Account for glyph width when pasting
Fixes glyphs not expanding up to their maximum width if necessary when pasting larger glyphs into smaller ones.
This commit is contained in:
parent
281805696b
commit
c1744822a1
2 changed files with 9 additions and 3 deletions
|
@ -115,8 +115,10 @@ void GlyphEditorWidget::paste_glyph()
|
|||
}
|
||||
|
||||
auto bitmap = font().raw_glyph(m_glyph).glyph_bitmap();
|
||||
for (int x = 0; x < min(bitmap.width(), buffer_width); x++) {
|
||||
for (int y = 0; y < min(bitmap.height(), buffer_height); y++) {
|
||||
if (bitmap.width() < buffer_width)
|
||||
font().set_glyph_width(m_glyph, min(buffer_width, font().max_glyph_width()));
|
||||
for (int x = 0; x < min(buffer_width, font().max_glyph_width()); x++) {
|
||||
for (int y = 0; y < min(buffer_height, font().glyph_height()); y++) {
|
||||
bitmap.set_bit_at(x, y, bits[x][y]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue