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