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
{
const int POST_PROCESSING_PRECISION = 3;
private List<List<Point>> _drawings;
private List<List<Point>> _drawingsRedo;
private List<Color> _colors;
@@ -89,10 +91,13 @@ namespace Paint_2
WidthsRedo = new List<int>();
}
public void Stop()
{
for (int i = 0;i<POST_PROCESSING_PRECISION;i++)
{
List<Point> Drawing = Drawings[Drawings.Count - 1];
Drawings[Drawings.Count - 1] = PostProcessing(Drawing);
}
}
private List<Point> PostProcessing(List<Point> Drawing)
{
//THIS SHOULD BE REMOVED, IT IS ONLY HERE TO BE EASIER TO DEBUG THE CONCEPT

View File

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