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]BoundingBox不会更新位置 #3

Open
happyfire opened this issue May 3, 2018 · 0 comments
Open

[bug]BoundingBox不会更新位置 #3

happyfire opened this issue May 3, 2018 · 0 comments

Comments

@happyfire
Copy link

happyfire commented May 3, 2018

getWorldBbox: function () {
if (this._commands.worldBbox === undefined || this._transformDirty) {
this._analysis();
}

    return this._commands.worldBbox;
},

transform更新时,this._transformDirty会被置为false,因此boundingbox不会在transform更新后更新。解决这个问题,必须是transform更新时同时更新bounding box。但是我看了下,transform相关方法是mixin进来到path的,所以transform和bounding box是隔离的,不知道怎么改好了。

补充一下:我需要bounding box是为了做一个碰撞的优化,先使用bouding box检测,然后再使用另外一个库对path进行相交检测。如果ccc.raphael能直接支持更好了

再补充一下:水母的那个例子打开showboundingbox之后看到的boundingbox是正常更新的,但其实是因为那个例子在update里面调用了
this.path.points(this.pathPoints, true);
this.path.smooth();
把这两行都注掉就会发现水母还在动,但bounding box停在原地了

@2youyou2 作者你好! [email protected]是你qq吗,可以加一下吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant