From 0bd4c5cc51eb400e985d77911c37fd02bf574f07 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Mon, 25 Dec 2023 21:21:28 +0800 Subject: [PATCH] fix: double-click to expand selection boundary error --- src/editor/core/event/handlers/click.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/editor/core/event/handlers/click.ts b/src/editor/core/event/handlers/click.ts index ba2814c..ce9c727 100644 --- a/src/editor/core/event/handlers/click.ts +++ b/src/editor/core/event/handlers/click.ts @@ -57,8 +57,10 @@ function dblclick(host: CanvasEvent, evt: MouseEvent) { } } // 设置选中区域 + const startIndex = index - upCount - 1 + if (!~startIndex) return const rangeManager = draw.getRange() - rangeManager.setRange(index - upCount - 1, index + downCount) + rangeManager.setRange(startIndex, index + downCount) // 刷新文档 draw.render({ isSubmitHistory: false,