Skip to content

Commit 9a17288

Browse files
committed
fix: updateCell
1 parent 08cfc20 commit 9a17288

8 files changed

Lines changed: 5076 additions & 10070 deletions
7 Bytes
Binary file not shown.

model/field-block.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,9 @@ export class FieldBlock {
668668
* This is for editor use.
669669
*/
670670
updateCell(i: number, j: number, cell: string): void {
671-
this.#field[j] = this.#field[j].substring(0, i) + cell +
672-
this.#field[j].substring(i + 1)
671+
const [relI, relJ] = g2l(i, j)
672+
this.#field[relJ] = this.#field[relJ].substring(0, relI) + cell +
673+
this.#field[relJ].substring(relI + 1)
673674
}
674675
get i(): number {
675676
return this.#i

0 commit comments

Comments
 (0)