mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:28:12 +00:00
FontEditor: Set width on copy only if source glyph is present
Fixes empty glyphs copying as present in fixed-width fonts.
This commit is contained in:
parent
212817ea20
commit
cdd1bc64f6
1 changed files with 1 additions and 1 deletions
|
@ -905,7 +905,7 @@ void FontEditorWidget::paste_glyphs()
|
|||
|
||||
for (size_t i = 0; i < range_bound_glyph_count; ++i) {
|
||||
auto copyable_width = edited_font().is_fixed_width()
|
||||
? edited_font().glyph_fixed_width()
|
||||
? data[bytes_per_copied_glyph * glyph_count + i] ? edited_font().glyph_fixed_width() : 0
|
||||
: min(edited_font().max_glyph_width(), data[bytes_per_copied_glyph * glyph_count + i]);
|
||||
memcpy(&rows[i * bytes_per_glyph], &data[i * bytes_per_copied_glyph], copyable_bytes_per_glyph);
|
||||
memset(&widths[i], copyable_width, sizeof(u8));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue