Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativeRectangle'/> class with the specified location and size.
 /// </summary>
 public RelativeRectangle(RelativePoint location, RelativeSize size)
 {
     x      = location.X;
     y      = location.Y;
     width  = size.Width;
     height = size.Height;
 }
Example #2
0
 /// <summary>
 /// Inflates this <see cref='RelativeRectangle'/> by the specified amount.
 /// </summary>
 public void Inflate(RelativeLength x, RelativeLength y)
 {
     X      -= x;
     Y      -= y;
     Width  += 2 * x;
     Height += 2 * y;
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativeRectangle'/> class with the specified location and size.
 /// </summary>
 public RelativeRectangle(RelativeLength x, RelativeLength y, RelativeLength width, RelativeLength height)
 {
     this.x      = x;
     this.y      = y;
     this.width  = width;
     this.height = height;
 }
Example #4
0
        /// <summary>
        /// Creates a <see cref='RelativeRectangle'/> that is inflated by the specified amount.
        /// </summary>
        public static RelativeRectangle Inflate(RelativeRectangle rect, RelativeLength x, RelativeLength y)
        {
            RelativeRectangle r = rect;

            r.Inflate(x, y);
            return(r);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativeThickness'/> class.
 /// </summary>
 public RelativeThickness(RelativeLength top, RelativeLength right, RelativeLength bottom, RelativeLength left)
 {
     this.top    = top;
     this.right  = right;
     this.bottom = bottom;
     this.left   = left;
 }
 /// <summary>
 /// Inflates this <see cref='RelativeThickness'/> by the specified amount.
 /// </summary>
 public void Inflate(RelativeLength value)
 {
     Top    += value;
     Right  += value;
     Bottom += value;
     Left   += value;
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativePoint'/> class with the specified coordinates.
 /// </summary>
 public RelativePoint(RelativeLength x, RelativeLength y)
 {
     this.x = x;
     this.y = y;
 }
Example #8
0
 /// <summary>
 /// Creates a new <see cref='RelativeRectangle'/> with the specified location and size.
 /// </summary>
 public static RelativeRectangle FromLTRB(RelativeLength left, RelativeLength top, RelativeLength right, RelativeLength bottom) =>
 new RelativeRectangle(left, top, right - left, bottom - top);
Example #9
0
 /// <summary>
 /// Adjusts the location of this rectangle by the specified amount.
 /// </summary>
 public void Offset(RelativeLength x, RelativeLength y)
 {
     X += x;
     Y += y;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativeSize'/> class from the specified dimensions.
 /// </summary>
 public RelativeSize(RelativeLength width, RelativeLength height)
 {
     this.width  = width;
     this.height = height;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativeSize'/> class from the specified <see cref='RelativePoint'/>.
 /// </summary>
 public RelativeSize(RelativePoint pt)
 {
     width  = pt.X;
     height = pt.Y;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativeSize'/> class from the specified existing <see cref='RelativeSize'/>.
 /// </summary>
 public RelativeSize(RelativeSize size)
 {
     width  = size.width;
     height = size.height;
 }