Exemplo n.º 1
0
        public BuildComponentRectangle(string id, FabricStyle fabricStyle, Area area)
            : base(id)
        {
            if (fabricStyle == null)
            {
                throw new ArgumentNullException(nameof(fabricStyle));
            }
            if (area == null)
            {
                throw new ArgumentNullException(nameof(area));
            }

            if (area.Width < area.Height)
            {
                area = new Area(area.Height, area.Width);
            }

            m_area = area;

            m_styleKey = CreateStyleKey(fabricStyle, area);

            var rectangleShapeNode = new RectangleShapeNode(fabricStyle);
            var scale = DimensionScale.CreateIdentity(area.Width.Unit);

            rectangleShapeNode.UpdatePath(PathGeometries.Rectangle.CreatePath(m_area.Width, m_area.Height), PathOrientation.CreateDefault(), scale);

            m_rectangleShapeNode = rectangleShapeNode;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RectangleMode"/> class.
 /// </summary>
 public RectangleMode()
 {
     RootSceneNode = new RectangleShapeNode <float>()
     {
         Point = new Point2 <float>(10, 10),
         Size  = new Size2 <float>(20, 20)
     };
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RectangleMode"/> class.
 /// </summary>
 public RectangleMode()
 {
     RootSceneNode = new RectangleShapeNode<float>()
     {
         Point = new Point2<float>(10, 10),
         Size = new Size2<float>(20, 20)
     };
 }