示例#1
0
        /// <summary>
        /// Returns a copy of the Rect2d 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 Rect2d.</returns>
        public Rect2d GrowSide(Godot.Margin side, double 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);
        }
示例#2
0
        /// <summary>
        /// Returns a copy of the Rect2d 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 Rect2d.</returns>
        public Rect2d GrowMargin(Godot.Margin margin, double by)
        {
            var g = this;

            g = 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);
        }