Constructed GCodeRenderInfo instance should use current ActiveLayerIndex
- Clip to current LayerCount if now smaller - Issue MatterHackers/MCCentral#2497 Maintain GCode layer position across ReloadAll/Slice operations
This commit is contained in:
parent
36b7c2325d
commit
0173d42777
2 changed files with 11 additions and 1 deletions
|
|
@ -421,7 +421,7 @@ namespace MatterHackers.MatterControl
|
|||
this.GCodeRenderer = new GCodeRenderer(loadedGCode);
|
||||
this.RenderInfo = new GCodeRenderInfo(
|
||||
0,
|
||||
1,
|
||||
Math.Max(1, this.ActiveLayerIndex),
|
||||
Agg.Transform.Affine.NewIdentity(),
|
||||
1,
|
||||
0,
|
||||
|
|
@ -455,6 +455,14 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
// Assign property causing event and UI load
|
||||
this.LoadedGCode = loadedGCode;
|
||||
|
||||
// Constrain to max layers
|
||||
if (this.ActiveLayerIndex > loadedGCode.LayerCount)
|
||||
{
|
||||
this.ActiveLayerIndex = loadedGCode.LayerCount;
|
||||
}
|
||||
|
||||
ActiveLayerChanged?.Invoke(this, null);
|
||||
}
|
||||
|
||||
public void InvalidateBedMesh()
|
||||
|
|
|
|||
|
|
@ -99,6 +99,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
Visible = sceneContext.RendererOptions.RenderSpeeds,
|
||||
}));
|
||||
}
|
||||
|
||||
this.Invalidate();
|
||||
}
|
||||
|
||||
public override void OnClosed(ClosedEventArgs e)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue