From e03feb210282779ecebb7af3d9a3801392b66979 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Tue, 6 Feb 2024 15:09:04 +0800 Subject: [PATCH] fix: cursor position error when scaling the page #434 --- src/editor/core/draw/Draw.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/editor/core/draw/Draw.ts b/src/editor/core/draw/Draw.ts index 0dff576..0a2dbc9 100644 --- a/src/editor/core/draw/Draw.ts +++ b/src/editor/core/draw/Draw.ts @@ -843,9 +843,11 @@ export class Draw { p.style.marginBottom = `${this.getPageGap()}px` this._initPageContext(this.ctxList[i]) }) + const cursorPosition = this.position.getCursorPosition() this.render({ isSubmitHistory: false, - isSetCursor: false + isSetCursor: !!cursorPosition, + curIndex: cursorPosition?.index }) if (this.listener.pageScaleChange) { this.listener.pageScaleChange(payload)