public void CenterPartInView()
        {
            gCodeRenderer = new GCodeRenderer(loadedGCode);
            RectangleDouble partBounds     = loadedGCode.GetBounds();
            Vector2         weightedCenter = loadedGCode.GetWeightedCenter();

            unscaledRenderOffset = -weightedCenter;
            layerScale           = Math.Min(Height / partBounds.Height, Width / partBounds.Width);

            Invalidate();
        }