예제 #1
0
        public List <System.Windows.Shapes.Shape> Drawables()
        {
            List <System.Windows.Shapes.Shape> drawables = new List <System.Windows.Shapes.Shape>();

            drawables.Add(MainIslandShape.Shape.GetWrappedPolygon());
            foreach (var pullRequestShape in PullRequestShapes.Drawables())
            {
                drawables.Add(pullRequestShape);
            }

            return(drawables);
        }
예제 #2
0
        private void SetLocation(System.Windows.Point newLocation, PointCollection drawablePoints)
        {
            var relocatedDrawablePoints = GetRelocatedShapePoints(drawablePoints, newLocation);

            MainIslandShape.SetPoints(relocatedDrawablePoints);
            PullRequestShapes.Move(newLocation);

            var shapeCentre = new System.Windows.Point(newLocation.X, newLocation.Y);

            CentrePoint = shapeCentre;

            // we use the following for collision detection
            var widthAndHeight = MainIslandShape.GetWidthAndHeight(drawablePoints); // only accepts centred points
            var width          = widthAndHeight.X;

            Width = width;
            var height = widthAndHeight.Y;

            Height = height;
        }