ArgumentOutOfRange exception when using GridLayouter

Sep 30, 2014 at 6:30 AM
Edited Sep 30, 2014 at 6:32 AM
When using GridLayouter with empty diagram, the ArgumentOutOfRangeException is thrown:
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Dataweb.NShape.Layouters.LayouterBase.CalcLayoutArea()
at Dataweb.NShape.Layouters.GridLayouter.ExecuteStepCore()
at Dataweb.NShape.Layouters.LayouterBase.ExecuteStep()
at Dataweb.NShape.Layouters.LayouterBase.Execute(Int32 maxSeconds)
The code to reproduce the issue:
this.Project.Name = "Test project";
this.Project.Create();

// Initialize project with a shape library
this.Project.AddLibrary(Assembly.GetExecutingAssembly(), false);

this.Diagram = new Diagram("Test");

this.Project.Repository.InsertAll(this.Diagram);

RepulsionLayouter repulsionLayouter = new RepulsionLayouter(this.Project);
repulsionLayouter.Execute(10);

GridLayouter gridLayouter = new GridLayouter(this.Project);
gridLayouter.Execute(10);
Coordinator
Sep 30, 2014 at 8:05 AM
Thanks for the feedback. I can reproduce the issue and we will fix it.