private static RectangleF RemoveMargin(RectangleF bounds, Margins margin) { bounds.Width += margin.Horizontal; bounds.X -= margin.Left; bounds.Height += margin.Vertical; bounds.Y -= margin.Top; return bounds; }
private static RectangleF AddMargin(RectangleF bounds, Margins margin) { bounds.Width -= margin.Horizontal; bounds.X += margin.Left; bounds.Height -= margin.Vertical; bounds.Y += margin.Top; return bounds; }