diff --git a/MatterControlLib/DesignTools/LithophaneObject3D.cs b/MatterControlLib/DesignTools/LithophaneObject3D.cs index e816fbf53..9c333f710 100644 --- a/MatterControlLib/DesignTools/LithophaneObject3D.cs +++ b/MatterControlLib/DesignTools/LithophaneObject3D.cs @@ -31,6 +31,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; +using MatterHackers.Agg; using MatterHackers.Agg.Platform; using MatterHackers.Agg.UI; using MatterHackers.DataConverters3D; @@ -92,6 +93,21 @@ namespace MatterHackers.MatterControl.Plugins.Lithophane this.DebugDepth("Rebuild"); var activeImage = this.ImageChild.Image; + if (activeImage == null + || activeImage.Width == 0 + || activeImage.Height == 0) + { + return Task.CompletedTask; + } + + activeImage.GetVisibleBounds(out RectangleInt visibleBounds); + + if (visibleBounds.Width == 0 + || visibleBounds.Height == 0) + { + return Task.CompletedTask; + } + ApplicationController.Instance.Tasks.Execute("Generating Lithophane".Localize(), null, (reporter, cancellationToken) => { var generatedMesh = Lithophane.Generate( diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 4f8dfe49e..859bcc06d 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 4f8dfe49e47e0cdf1e3d954edaa189f87b4adc49 +Subproject commit 859bcc06d3dd9afb98f6a395ca730230321bc985