Ejemplo n.º 1
0
 public Rectangle(XmlNode node)
 {
     Left   = new VerticalSlice(node.GetValue("left"));
     Right  = new VerticalSlice(node.GetValue("right"));
     Top    = new HorizontalSlice(node.GetValue("top"));
     Bottom = new HorizontalSlice(node.GetValue("bottom"));
 }
Ejemplo n.º 2
0
 public Rectangle(XmlNode node)
 {
     Left = new VerticalSlice(node.GetValue("left"));
       Right = new VerticalSlice(node.GetValue("right"));
       Top = new HorizontalSlice(node.GetValue("top"));
       Bottom = new HorizontalSlice(node.GetValue("bottom"));
 }
Ejemplo n.º 3
0
 public Rectangle(VerticalSlice left, VerticalSlice right,
                  HorizontalSlice top, HorizontalSlice bottom)
 {
     Left   = left;
     Right  = right;
     Top    = top;
     Bottom = bottom;
 }
Ejemplo n.º 4
0
 public Rectangle(VerticalSlice left, VerticalSlice right,
     HorizontalSlice top, HorizontalSlice bottom)
 {
     Left = left;
       Right = right;
       Top = top;
       Bottom = bottom;
 }
Ejemplo n.º 5
0
        void CreateSliceFromXmlNode(XmlNode node)
        {
            var type = (XmlAttribute)node.Attributes.GetNamedItem("type");

            if (type.Value == "horizontal")
            {
                _horizontalSlices.Add(HorizontalSlice.Load(node));
            }
            else
            {
                _verticalSlices.Add(VerticalSlice.Load(node));
            }
        }
Ejemplo n.º 6
0
        public void Init(Drawable drawable)
        {
            int width  = drawable.Width;
            int height = drawable.Height;

            var left = new VerticalSlice(null, null, 0)
            {
                Locked = true
            };

            _verticalSlices.Add(left);

            var right = new VerticalSlice(null, null, width)
            {
                Locked = true
            };

            _verticalSlices.Add(right);

            var top = new HorizontalSlice(left, right, 0)
            {
                Locked = true
            };

            _horizontalSlices.Add(top);

            var bottom = new HorizontalSlice(left, right, height)
            {
                Locked = true
            };

            _horizontalSlices.Add(bottom);

            left.Begin = right.Begin = top;
            left.End   = right.End = bottom;

            _rectangles.Add(new Rectangle(left, right, top, bottom));

            Changed = false;
        }
Ejemplo n.º 7
0
        public void Init(Drawable drawable)
        {
            int width = drawable.Width;
              int height = drawable.Height;

              var left = new VerticalSlice(null, null, 0) {Locked = true};
              _verticalSlices.Add(left);

              var right = new VerticalSlice(null, null, width) {Locked = true};
              _verticalSlices.Add(right);

              var top = new HorizontalSlice(left, right, 0) {Locked = true};
              _horizontalSlices.Add(top);

              var bottom = new HorizontalSlice(left, right, height) {Locked = true};
              _horizontalSlices.Add(bottom);

              left.Begin = right.Begin = top;
              left.End = right.End = bottom;

              _rectangles.Add(new Rectangle(left, right, top, bottom));

              Changed = false;
        }
Ejemplo n.º 8
0
 public bool HasHorizontalSlice(HorizontalSlice slice)
 {
     return((slice.Y == Y1 || slice.Y == Y2) &&
            slice.X1 == X1 && slice.X2 == X2);
 }
Ejemplo n.º 9
0
 public bool HasHorizontalSlice(HorizontalSlice slice)
 {
     return (slice.Y == Y1 || slice.Y == Y2)
     && slice.X1 == X1 && slice.X2 == X2;
 }