Skip to content

Commit 0f57256

Browse files
authored
fix: 解决当 hitShape 为空时 readonly 报错
1 parent 4287fdc commit 0f57256

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ export default class CanvasSelect extends EventBus {
410410
} else {
411411
// 是否点击到形状
412412
const [hitShapeIndex, hitShape] = this.hitOnShape(this.mouse);
413-
if (hitShape.readonly) return;
414413
if (hitShapeIndex > -1 && hitShape) {
414+
if (hitShape.readonly) return;
415415
hitShape.dragging = true;
416416
this.dataset.forEach((item, i) => item.active = i === hitShapeIndex);
417417
this.dataset.splice(hitShapeIndex, 1);

0 commit comments

Comments
 (0)