ccc.raphael icon indicating copy to clipboard operation
ccc.raphael copied to clipboard

[bug]BoundingBox不会更新位置

Open happyfire opened this issue 6 years ago • 0 comments

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吗,可以加一下吗?

happyfire avatar May 03 '18 11:05 happyfire