コード例 #1
0
        public override void MoveToCore(Point newLocation)
        {
            base.MoveToCore(newLocation);

            if (Figure != null)
            {
                if (Figure is PBRect)
                {
                    PBRect rect = Figure as PBRect;

                    rect.Width = Math.Abs(rect.Coordinates.X - Coordinates.X) * 2;

                    rect.Height = Math.Abs(rect.Coordinates.Y - Coordinates.Y) * 2;

                    rect.UpdateVisual();
                }

                if (Figure is PBCircle)
                {
                    PBCircle circle = Figure as PBCircle;

                    circle.Radius = Math.Distance(circle.Coordinates.X, circle.Coordinates.Y, Coordinates.X, Coordinates.Y);

                    circle.UpdateVisual();
                }
            }
        }
コード例 #2
0
ファイル: Factory.cs プロジェクト: WittyOrator/Playbook
        public static PBCircle CreateCircleShape(Drawing drawing, System.Windows.Point coordinates)
        {
            PBCircle circle = new PBCircle()
            {
                Drawing = drawing
            };

            circle.MoveTo(coordinates);
            circle.Radius = 1;

            if (Behavior.DrawVideo)
            {
                circle.Shape.Stroke = new SolidColorBrush(Color);
                circle.Shape.Fill   = Brushes.Transparent;
            }

            return(circle);
        }