Esempio n. 1
0
        public void Notify_IncreaseSize()
        {
            Point[] bounds = new Point[PointsList.Count];
            PointsList.CopyTo(bounds, 0);

            foreach (Figure figure in Observers)
            {
                double figureThicknessHalf = figure.GetBorderThickness() / 2;
                bounds[0].X += figureThicknessHalf;//
                bounds[1].X -= figureThicknessHalf;
                bounds[0].Y += figureThicknessHalf;
                bounds[1].Y -= figureThicknessHalf;


                if (figure.GetPointCollection().Any(point => point.X < bounds[0].X || point.X > bounds[1].X || point.Y <bounds[0].Y || point.Y> bounds[1].Y))
                {
                    continue;
                }

                figure.IncreaseSize();
            }
        }