Tools/MaterialTool/Controls/DiagramControl.cs
/// <summary>
/// Updates the control CanvasAdapter's bounds</summary>
Updates the control CanvasAdapter's bounds
Updates the control CanvasAdapter ' s bounds
protected virtual void SetCanvasBounds()
        {
            if (_control != null && _control.Visible)
            {
                Rectangle bounds = GetClientSpaceBounds();
                var transformAdapter = _control.As<ITransformAdapter>();
                bounds = GdiUtil.InverseTransform(transformAdapter.Transform, bounds);
                Rectangle clientRect = GdiUtil.InverseTransform(transformAdapter.Transform, _control.ClientRectangle);
                bounds.Width = Math.Max(bounds.Width * 2, clientRect.Width * 2);
                bounds.Height = Math.Max(bounds.Height * 2, clientRect.Height * 2);
                var canvasAdapter = _control.As<ICanvasAdapter>();
                if (canvasAdapter != null)
                    canvasAdapter.Bounds = bounds;
            }
        }
protected virtual void SetCanvasBounds ( ) { if ( _control != null && _control . Visible ) { Rectangle bounds = GetClientSpaceBounds ( ) ; var transformAdapter = _control . As < ITransformAdapter > ( ) ; bounds = GdiUtil . InverseTransform ( transformAdapter . Transform , bounds ) ; Rectangle clientRect = GdiUtil . InverseTransform ( transformAdapter . Transform , _control . ClientRectangle ) ; bounds . Width = Math . Max ( bounds . Width * 2 , clientRect . Width * 2 ) ; bounds . Height = Math . Max ( bounds . Height * 2 , clientRect . Height * 2 ) ; var canvasAdapter = _control . As < ICanvasAdapter > ( ) ; if ( canvasAdapter != null ) canvasAdapter . Bounds = bounds ; } }
Updates the control CanvasAdapter's bounds
Updates the control CanvasAdapter ' s bounds
// update the control CanvasAdapter's bounds //transform to world coordinates // Make the canvas larger than it needs to be to give the user some room. // Use the client rectangle in world coordinates.