fix: applying 1-width at odd location

This commit is contained in:
Shibo Lyu 2024-12-29 22:32:59 +08:00
parent 5077995eb3
commit 91db478fe9
3 changed files with 22 additions and 12 deletions

View file

@ -44,7 +44,7 @@ export function applyChange(change: BoardChange, section: SectionData) {
if (change.ch) {
const chWidth = getCharacterWidth(change.ch);
const xCharacterOffset = xInSection % 2;
const xCharacterOffset = xInSection % chWidth;
const offsetAdjustedXInSection = xInSection - xCharacterOffset;
section.ch[yInSection][offsetAdjustedXInSection] = change.ch;
section.width[yInSection][offsetAdjustedXInSection] = chWidth;