Пример #1
0
        public Rect2i GrowMargin(Godot.Margin margin, int by)
        {
            var g = this;

            g.GrowIndividual(Godot.Margin.Left == margin ? by : 0,
                             Godot.Margin.Top == margin ? by : 0,
                             Godot.Margin.Right == margin ? by : 0,
                             Godot.Margin.Bottom == margin ? by : 0);

            return(g);
        }
Пример #2
0
        /// <summary>
        /// Returns a copy of the Rect2i grown by the specified amount on the specified Side.
        /// </summary>
        /// <param name="side">The side to grow.</param>
        /// <param name="by">The amount to grow by.</param>
        /// <returns>The grown Rect2i.</returns>
        public Rect2i GrowSide(Godot.Margin side, int by)
        {
            var g = this;

            g = g.GrowIndividual(Godot.Margin.Left == side ? by : 0,
                                 Godot.Margin.Top == side ? by : 0,
                                 Godot.Margin.Right == side ? by : 0,
                                 Godot.Margin.Bottom == side ? by : 0);

            return(g);
        }