Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/SharpVectorModel/Paths/SvgPathSegLinetoHorizontalAbs.cs @ 13757

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

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

File size: 1.1 KB
RevLine 
[12762]1using System;
2using System.Text;
3
4namespace SharpVectors.Dom.Svg
5{
6    public sealed class SvgPathSegLinetoHorizontalAbs : SvgPathSegLineto, ISvgPathSegLinetoHorizontalAbs
7    {
8        private double x;
9
10        public SvgPathSegLinetoHorizontalAbs(double x)
11            : base(SvgPathSegType.LineToHorizontalAbs)
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(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.