Example #1
0
 private void CollapseGroupBox(BaseController canvasController, FlowSharpLib.GroupBox gb, IEnumerable <GraphicElement> children)
 {
     canvasController.Redraw(gb, _ =>
     {
         gb.SetCollapsedState();
         gb.SaveExpandedSize();
         canvasController.Elements.Where(el => el.Parent == gb).ForEach(el => el.Visible = false);
         Rectangle r         = gb.DisplayRectangle;
         gb.DisplayRectangle = new Rectangle(r.Location, new Size(r.Width, 30));
         // Update connections after display rectangle has been updated, as this adjusts the connection points.
         canvasController.UpdateConnections(gb);
     });
     // In a collapse, the children, being intersecting with the groupbox, will be redrawn.
 }