Don't call ExandedChianged twice in TreeView
Let MeshWrapper call GetAxisAl/ignedBoundingBox from base
This commit is contained in:
parent
94e6d461e0
commit
7743a34a87
3 changed files with 1 additions and 30 deletions
|
|
@ -91,7 +91,6 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
expandWidget.Click += (s, e) =>
|
||||
{
|
||||
this.Expanded = !this.Expanded;
|
||||
this.ExpandedChanged?.Invoke(this, null);
|
||||
expandWidget.Expanded = this.Expanded;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -73,34 +73,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D
|
|||
base.Flatten(undoBuffer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MeshWrapperObject3D overrides GetAabb so that it can only check the geometry that it has created
|
||||
/// </summary>
|
||||
/// <param name="matrix"></param>
|
||||
/// <returns></returns>
|
||||
public override AxisAlignedBoundingBox GetAxisAlignedBoundingBox(Matrix4X4 matrix)
|
||||
{
|
||||
AxisAlignedBoundingBox totalBounds = AxisAlignedBoundingBox.Empty();
|
||||
|
||||
// This needs to be Descendants because we need to move past the first visible mesh to our owned objects
|
||||
foreach (var child in this.Descendants().Where(i => i.OwnerID == this.ID && i.Visible))
|
||||
{
|
||||
var childMesh = child.Mesh;
|
||||
if (childMesh != null)
|
||||
{
|
||||
// Add the bounds of each child object
|
||||
var childBounds = childMesh.GetAxisAlignedBoundingBox(child.WorldMatrix(this) * matrix);
|
||||
// Check if the child actually has any bounds
|
||||
if (childBounds.XSize > 0)
|
||||
{
|
||||
totalBounds += childBounds;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return totalBounds;
|
||||
}
|
||||
|
||||
public IEnumerable<(IObject3D original, IObject3D meshCopy)> WrappedObjects()
|
||||
{
|
||||
return this.Descendants()
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit c0dd75b189ef909264a736e7d9db9eca67a0c333
|
||||
Subproject commit 7025350cc177646c67ec926ee0ca7a7f914d63be
|
||||
Loading…
Add table
Add a link
Reference in a new issue