/// <summary> /// Moves shapeToMove so that its topleft corner /// corresponds with the topleft corner of reference. /// </summary> /// <param name="reference"></param> /// <param name="shapeToMove"></param> public static void PutAtRight( IDrawableRect reference, IDrawableRect shapeToMove, int Margin) { shapeToMove.MoveTo( reference.Bounds.Location.X + Margin, reference.Bounds.Location.Y); }
/// <summary> /// Puts a shapeToMove to the right from reference. /// </summary> /// <param name="xreference"></param> /// <param name="yreference"></param> /// <param name="shapeToMove"></param> public static void PutRight( IDrawableRect xreference, IDrawableRect yreference, IDrawableRect shapeToMove, int Margin) { shapeToMove.MoveTo( xreference.Bounds.Right + 1 + Margin, yreference.Bounds.Location.Y ); }
/// <summary> /// Moves a shapeToMove so that it is left-aligned with reference /// and is below it. /// </summary> /// <param name="reference"></param> /// <param name="shapeToMove"></param> public static void PutUnder( IDrawableRect reference, IDrawableRect shapeToMove, int Margin ) { shapeToMove.MoveTo( reference.Bounds.Location.X, reference.Bounds.Bottom + 1 + Margin ); }
/// <summary> /// Puts the shapeToMove under reference /// and "indent" pixels to the right /// </summary> /// <param name="reference"></param> /// <param name="shapeToMove"></param> /// <param name="indent"></param> public static void PutUnderAndIndent( IDrawableRect reference, IDrawableRect shapeToMove, int indent, int margin ) { shapeToMove.MoveTo( reference.Bounds.Location.X + indent, reference.Bounds.Bottom + 1 + margin ); }
public static void PutUnderAndIndentFrom( IDrawableRect xReference, IDrawableRect yReference, IDrawableRect shapeToMove, int indent, int margin ) { shapeToMove.MoveTo( xReference.Bounds.Location.X + indent, yReference.Bounds.Bottom + margin ); }
/// <summary> /// Resizes a shapeToResize to be a minimal rectangle /// which fully contains leftTopShape in the top left corner /// and fully contains bottomRightShape in the bottom right corner. /// </summary> public static void PutAround( IDrawableRect leftTopShape, IDrawableRect bottomRightShape, IDrawableRect shapeToResize, int xMargin, int yMargin ) { shapeToResize.MoveTo( leftTopShape.Bounds.Location.X - xMargin, leftTopShape.Bounds.Location.Y - yMargin); shapeToResize.Bounds.Size.Set( bottomRightShape.Bounds.Right - leftTopShape.Bounds.Location.X + 2 * xMargin, bottomRightShape.Bounds.Bottom - leftTopShape.Bounds.Location.Y + 2 * yMargin ); }
/// <summary> /// Moves a shapeToMove so that it is left-aligned with reference /// and is below it. /// </summary> /// <param name="xreference"></param> /// <param name="yreference"></param> /// <param name="shapeToMove"></param> public static void PutUnder( IDrawableRect xreference, IDrawableRect yreference, IDrawableRect shapeToMove, int Margin ) { shapeToMove.MoveTo( xreference.Bounds.Location.X, yreference.Bounds.Bottom + 1 + Margin ); }
/// <summary> /// Resizes a shapeToResize to be a minimal rectangle /// which fully contains leftTopShape in the top left corner /// and fully contains bottomRightShape in the bottom right corner. /// </summary> public static void PutAround( IDrawableRect leftTopShape, IDrawableRect RightShape, IDrawableRect bottomShape, IDrawableRect shapeToResize, int xMargin, int yMargin ) { shapeToResize.MoveTo( leftTopShape.Bounds.Location.X - xMargin, leftTopShape.Bounds.Location.Y - yMargin); shapeToResize.Bounds.Size.Set( RightShape.Bounds.Right - leftTopShape.Bounds.Location.X + 2 * xMargin, bottomShape.Bounds.Bottom - leftTopShape.Bounds.Location.Y + 2 * yMargin ); }