Added a post processing precision ratio

This commit is contained in:
2022-05-31 15:50:06 +02:00
parent c3728b01fc
commit f25d3c1bcf
2 changed files with 14 additions and 4 deletions

View File

@@ -14,6 +14,8 @@ namespace Paint_2
{ {
public class DotPencil : PaintTool public class DotPencil : PaintTool
{ {
const int POST_PROCESSING_PRECISION = 3;
private List<List<Point>> _drawings; private List<List<Point>> _drawings;
private List<List<Point>> _drawingsRedo; private List<List<Point>> _drawingsRedo;
private List<Color> _colors; private List<Color> _colors;
@@ -90,8 +92,11 @@ namespace Paint_2
} }
public void Stop() public void Stop()
{ {
List<Point> Drawing = Drawings[Drawings.Count - 1]; for (int i = 0;i<POST_PROCESSING_PRECISION;i++)
Drawings[Drawings.Count - 1] = PostProcessing(Drawing); {
List<Point> Drawing = Drawings[Drawings.Count - 1];
Drawings[Drawings.Count - 1] = PostProcessing(Drawing);
}
} }
private List<Point> PostProcessing(List<Point> Drawing) private List<Point> PostProcessing(List<Point> Drawing)
{ {

View File

@@ -14,6 +14,8 @@ namespace Paint_2
{ {
public class Pencil : PaintTool public class Pencil : PaintTool
{ {
const int POST_PROCESSING_PRECISION = 3;
private List<List<Point>> _drawings; private List<List<Point>> _drawings;
private List<List<Point>> _drawingsRedo; private List<List<Point>> _drawingsRedo;
private List<Color> _colors; private List<Color> _colors;
@@ -91,8 +93,11 @@ namespace Paint_2
} }
public void Stop() public void Stop()
{ {
List<Point> Drawing = Drawings[Drawings.Count - 1]; for (int i = 0; i < POST_PROCESSING_PRECISION; i++)
Drawings[Drawings.Count - 1] = PostProcessing(Drawing); {
List<Point> Drawing = Drawings[Drawings.Count - 1];
Drawings[Drawings.Count - 1] = PostProcessing(Drawing);
}
} }
private List<Point> PostProcessing(List<Point> Drawing) private List<Point> PostProcessing(List<Point> Drawing)
{ {