예제 #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"));
 }
예제 #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"));
 }
예제 #3
0
 public Rectangle(VerticalSlice left, VerticalSlice right,
                  HorizontalSlice top, HorizontalSlice bottom)
 {
     Left   = left;
     Right  = right;
     Top    = top;
     Bottom = bottom;
 }
예제 #4
0
 public Rectangle(VerticalSlice left, VerticalSlice right,
     HorizontalSlice top, HorizontalSlice bottom)
 {
     Left = left;
       Right = right;
       Top = top;
       Bottom = bottom;
 }
예제 #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));
            }
        }
예제 #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;
        }
예제 #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;
        }
예제 #8
0
 public bool HasHorizontalSlice(HorizontalSlice slice)
 {
     return((slice.Y == Y1 || slice.Y == Y2) &&
            slice.X1 == X1 && slice.X2 == X2);
 }
예제 #9
0
 public bool HasHorizontalSlice(HorizontalSlice slice)
 {
     return (slice.Y == Y1 || slice.Y == Y2)
     && slice.X1 == X1 && slice.X2 == X2;
 }