Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/SharpVectorModel/Paths/SvgPathSegLinetoHorizontalRel.cs @ 13177

Last change on this file since 13177 was 12762, checked in by aballeit, 9 years ago

#2283 GUI updates, Tree-chart, MCTS Version 2 (prune leaves)

File size: 1.1 KB
Line 
1using System;
2using System.Text;
3
4namespace SharpVectors.Dom.Svg
5{
6    public sealed class SvgPathSegLinetoHorizontalRel : SvgPathSegLineto, ISvgPathSegLinetoHorizontalRel
7    {
8        private double x;
9
10        public SvgPathSegLinetoHorizontalRel(double x)
11            : base(SvgPathSegType.LineToHorizontalRel)
12        {
13            this.x = x;
14        }
15
16        public double X
17        {
18            get { return x; }
19            set { x = value; }
20        }
21
22        public override SvgPointF AbsXY
23        {
24            get
25            {
26                SvgPathSeg prevSeg = PreviousSeg;
27                SvgPointF prevPoint;
28                if (prevSeg == null) prevPoint = new SvgPointF(0, 0);
29                else prevPoint = prevSeg.AbsXY;
30                return new SvgPointF(prevPoint.X + X, prevPoint.Y);
31            }
32        }
33
34        public override string PathText
35        {
36            get
37            {
38                StringBuilder sb = new StringBuilder();
39                sb.Append(PathSegTypeAsLetter);
40                sb.Append(X);
41
42                return sb.ToString();
43            }
44        }
45    }
46}
Note: See TracBrowser for help on using the repository browser.