root/plot/Pybrary.Plot/Margins.cs

Revision 746, 0.8 kB (checked in by mfenniak, 2 years ago)

--

Line 
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Drawing;
5
6 namespace Pybrary.Plot
7 {
8     /// <summary>
9     /// Defines margins for an object, in inches.
10     /// </summary>
11     class Margins
12     {
13         private float left;
14         private float right;
15         private float top;
16         private float bottom;
17
18         public Margins(float left, float top, float right, float bottom)
19         {
20             this.left = left;
21             this.top = top;
22             this.right = right;
23             this.bottom = bottom;
24         }
25
26         public void Apply(ref AdvancedRect rect)
27         {
28             rect.TopLeft.X += this.left;
29             rect.TopLeft.Y += this.top;
30             rect.BottomRight.X -= this.right;
31             rect.BottomRight.Y -= this.bottom;
32         }
33     }
34 }
Note: See TracBrowser for help on using the browser.