Fixed the bug where resising the window and undo or clear crashes
This commit is contained in:
@@ -12,7 +12,7 @@ using System.Drawing;
|
||||
|
||||
namespace Paint_2
|
||||
{
|
||||
public class DotPencil:PaintTool
|
||||
public class DotPencil : PaintTool
|
||||
{
|
||||
private List<List<Point>> _drawings;
|
||||
private List<List<Point>> _drawingsRedo;
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Paint_2
|
||||
private void ForceRefresh()
|
||||
{
|
||||
canvas.Image = sketch.ForcePaint();
|
||||
RefreshUi();
|
||||
//RefreshUi();
|
||||
}
|
||||
private void RefreshUi()
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Paint_2
|
||||
{
|
||||
internal class Pencil : PaintTool
|
||||
public class Pencil : PaintTool
|
||||
{
|
||||
private List<List<Point>> _drawings;
|
||||
private List<List<Point>> _drawingsRedo;
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace Paint_2
|
||||
if (newSize.Width > 0 && newSize.Height > 0)
|
||||
{
|
||||
Drawing = new Bitmap(newSize.Width, newSize.Height);
|
||||
SketchSize = newSize;
|
||||
}
|
||||
}
|
||||
public void ChangeTool(int toolId)
|
||||
|
||||
Reference in New Issue
Block a user