/// <summary> /// Creates a new instance of <see cref="SizeShort"/> from a specified <see cref="PointShort"/>. /// </summary> /// <param name="pt">The <see cref="PointShort"/> that should be used to create the <see cref="SizeShort"/>.</param> public SizeShort(PointShort pt) { Width = (pt.X); Height = (pt.Y); }
/// <summary> /// Offsets a <see cref="PointShort"/> by the specified <see cref="SizeShort"/>. /// </summary> /// <param name="pt">The <see cref="PointShort"/> that should be offset.</param> /// <param name="sz">The <see cref="SizeShort"/> to offset by.</param> /// <returns>A new <see cref="PointShort"/> that has been offset.</returns> public static PointShort Add(PointShort pt, SizeShort sz) => pt + sz;
/// <summary> /// Subtracts a <see cref="PointShort"/> by a <see cref="SizeShort"/>. /// </summary> /// <param name="pt">The <see cref="PointShort"/> to be subtracted from.</param> /// <param name="sz">The <see cref="SizeShort"/> to subtract.</param> /// <returns>A <see cref="PointShort"/> representing the difference.</returns> public static PointShort Subtract(PointShort pt, SizeShort sz) => pt - sz;
/// <summary> /// Offsets the current <see cref="PointShort"/> by the specified <see cref="PointShort"/>. /// </summary> /// <param name="p">The <see cref="PointShort"/> to offest this <see cref="PointShort"/> by.</param> /// <returns>The new <see cref="PointShort"/>.</returns> public PointShort Offset(PointShort p) => new PointShort((short)(_x + p.X), (short)(_y + p.Y));