Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 某些情况下删除线失败 #260

Open
H-Dynamite opened this issue Oct 30, 2024 · 0 comments
Open

[Bug]: 某些情况下删除线失败 #260

H-Dynamite opened this issue Oct 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@H-Dynamite
Copy link

Code Sanbox异常重现

No response

bug描述

某些不正确的连接线导致删除线失败,界面一直残留这根线,一直多次重复报错如下
603f3880d5f8b7b0079e2c4ef5665f7
解决方式
canvas.ts 修改代码如下:

  getDelPens(pen, delPens) {
        if (!pen) {
            return;
        }
        const i = this.store.data.pens.findIndex((item) => item.id === pen.id);
        if (i > -1) {
            const delPen = this.store.pens[pen.id];
           // 增加如下判断
            if(delPen && delPen.calculative){
                delPen.calculative.active = undefined;
            }
            delPens.push(delPen);
        }
        if (pen.children) {
            pen.children.forEach((id) => {
                this.getDelPens(this.store.pens[id], delPens);
            });
        }
    }

期待效果

即使出现错误也要保证界面上删除

发生频率

偶尔

核心库版本

1.0.63

浏览器版本

Chrome130.0.6723.92

其他需要补充的

No response

@H-Dynamite H-Dynamite added the bug Something isn't working label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant