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; }
/// <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) }; }
/// <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) }; }