fix widget mesh move optimiztion that prevented track.box from being set
This commit is contained in:
parent
73e6712ccd
commit
41141816ba
1 changed files with 14 additions and 10 deletions
|
|
@ -440,18 +440,20 @@ class Widget {
|
|||
* todo use new prototype.moveMesh()
|
||||
*/
|
||||
moveMesh(x, y, z) {
|
||||
if (!(x || y || z)) {
|
||||
return;
|
||||
}
|
||||
// if (!(x || y || z)) {
|
||||
// return;
|
||||
// }
|
||||
let gap = this.mesh.geometry.attributes.position,
|
||||
pa = gap.array;
|
||||
// center point array on 0,0,0
|
||||
for (let i=0; i < pa.length; i += 3) {
|
||||
pa[i ] -= x;
|
||||
pa[i + 1] -= y;
|
||||
pa[i + 2] -= z;
|
||||
if (x || y || z) {
|
||||
for (let i=0; i < pa.length; i += 3) {
|
||||
pa[i ] -= x;
|
||||
pa[i + 1] -= y;
|
||||
pa[i + 2] -= z;
|
||||
}
|
||||
gap.needsUpdate = true;
|
||||
}
|
||||
gap.needsUpdate = true;
|
||||
let bb = this.groupBounds();
|
||||
// critical to layout and grouping
|
||||
this.track.box = {
|
||||
|
|
@ -461,8 +463,10 @@ class Widget {
|
|||
};
|
||||
// for use with the packer
|
||||
// invalidate cached points
|
||||
this.points = null;
|
||||
this.setModified();
|
||||
if (x || y || z) {
|
||||
this.points = null;
|
||||
this.setModified();
|
||||
}
|
||||
}
|
||||
|
||||
setIndexed(z) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue