Artemis.Profiles.ProfileModel.FixBoundaries C# (CSharp) Method

FixBoundaries() public method

Looks at all the layers wthin the profile and makes sure they are within boundaries of the given rectangle
public FixBoundaries ( Rect keyboardRectangle ) : void
keyboardRectangle Rect
return void
        public void FixBoundaries(Rect keyboardRectangle)
        {
            foreach (var layer in GetLayers())
            {
                if (!layer.LayerType.ShowInEdtor)
                    continue;

                var props = layer.Properties;
                var layerRect = new Rect(new Point(props.X, props.Y), new Size(props.Width, props.Height));
                if (keyboardRectangle.Contains(layerRect))
                    continue;

                props.X = 0;
                props.Y = 0;
                layer.Properties = props;
            }
        }