@@ -27,8 +27,6 @@ private Color PaintColor
2727 return ;
2828
2929 paintColor = value ;
30-
31- brush = new SolidBrush ( paintColor ) ;
3230 }
3331 }
3432
@@ -52,8 +50,6 @@ private ToolItem CurrentTool
5250 }
5351 }
5452
55- private SolidBrush brush ;
56-
5753 private Point dragMouseLocation = new Point ( 0 , 0 ) ;
5854 private Rectangle previousShapeBounds = new Rectangle ( ) ;
5955 private Rectangle newShapeBounds = new Rectangle ( ) ;
@@ -68,7 +64,6 @@ public Form()
6864 {
6965 InitializeComponent ( ) ;
7066
71- brush = new SolidBrush ( PaintColor ) ;
7267 commandHandler = new CommandHandler ( ) ;
7368 CurrentTool = ToolItem . None ;
7469
@@ -241,7 +236,7 @@ private void Picturebox_DrawArea_MouseDown(object sender, MouseEventArgs e)
241236 {
242237 case ToolItem . Rectangle :
243238
244- RectangleShape rectangle = new RectangleShape ( brush , e . Location , Constants . SHAPE_DEFAULT_WIDTH , Constants . SHAPE_DEFAULT_HEIGHT ) ;
239+ RectangleShape rectangle = new RectangleShape ( PaintColor , e . Location , Constants . SHAPE_DEFAULT_WIDTH , Constants . SHAPE_DEFAULT_HEIGHT ) ;
245240
246241 commandHandler . AddCommand ( new CreateShapeCommand ( rectangle ) ) ;
247242
@@ -250,7 +245,7 @@ private void Picturebox_DrawArea_MouseDown(object sender, MouseEventArgs e)
250245
251246 case ToolItem . Ellipse :
252247
253- EllipseShape ellipse = new EllipseShape ( brush , e . Location , Constants . SHAPE_DEFAULT_WIDTH , Constants . SHAPE_DEFAULT_HEIGHT ) ;
248+ EllipseShape ellipse = new EllipseShape ( PaintColor , e . Location , Constants . SHAPE_DEFAULT_WIDTH , Constants . SHAPE_DEFAULT_HEIGHT ) ;
254249
255250 commandHandler . AddCommand ( new CreateShapeCommand ( ellipse ) ) ;
256251
0 commit comments