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
Notes:
sideshowbarker
2024-07-17 17:01:46 +09:00
Author: https://github.com/thankyouverycool Commit: https://github.com/SerenityOS/serenity/commit/cdd1bc64f6 Pull-request: https://github.com/SerenityOS/serenity/pull/13143
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
Reference in a new issue