Fixed a bug where clearing was not actually clearing some history
This commit is contained in:
@@ -82,6 +82,11 @@ namespace Paint_2
|
|||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
Drawings = new List<List<Point>>();
|
Drawings = new List<List<Point>>();
|
||||||
|
DrawingsRedo = new List<List<Point>>();
|
||||||
|
Colors = new List<Color>();
|
||||||
|
ColorsRedo = new List<Color>();
|
||||||
|
Widths = new List<int>();
|
||||||
|
WidthsRedo = new List<int>();
|
||||||
}
|
}
|
||||||
public void Stop(Point point)
|
public void Stop(Point point)
|
||||||
{
|
{
|
||||||
|
|||||||
77
Paint_2/Form1.Designer.cs
generated
77
Paint_2/Form1.Designer.cs
generated
@@ -35,7 +35,6 @@
|
|||||||
this.btnSaveCopy = new System.Windows.Forms.Button();
|
this.btnSaveCopy = new System.Windows.Forms.Button();
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.lblSelectedColor = new System.Windows.Forms.Label();
|
this.lblSelectedColor = new System.Windows.Forms.Label();
|
||||||
this.btnImportImage = new System.Windows.Forms.Button();
|
|
||||||
this.panelFile = new System.Windows.Forms.Panel();
|
this.panelFile = new System.Windows.Forms.Panel();
|
||||||
this.label10 = new System.Windows.Forms.Label();
|
this.label10 = new System.Windows.Forms.Label();
|
||||||
this.panelDrawing = new System.Windows.Forms.Panel();
|
this.panelDrawing = new System.Windows.Forms.Panel();
|
||||||
@@ -70,11 +69,11 @@
|
|||||||
this.btnSetColor = new System.Windows.Forms.Button();
|
this.btnSetColor = new System.Windows.Forms.Button();
|
||||||
this.button1 = new System.Windows.Forms.Button();
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
this.panelTools = new System.Windows.Forms.Panel();
|
this.panelTools = new System.Windows.Forms.Panel();
|
||||||
|
this.btnRedo = new System.Windows.Forms.Button();
|
||||||
|
this.btnUndo = new System.Windows.Forms.Button();
|
||||||
this.btnRandomColor = new System.Windows.Forms.Button();
|
this.btnRandomColor = new System.Windows.Forms.Button();
|
||||||
this.label2 = new System.Windows.Forms.Label();
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
this.lsbTools = new System.Windows.Forms.ListBox();
|
this.lsbTools = new System.Windows.Forms.ListBox();
|
||||||
this.btnUndo = new System.Windows.Forms.Button();
|
|
||||||
this.btnRedo = new System.Windows.Forms.Button();
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.canvas)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.canvas)).BeginInit();
|
||||||
this.panelFile.SuspendLayout();
|
this.panelFile.SuspendLayout();
|
||||||
this.panelDrawing.SuspendLayout();
|
this.panelDrawing.SuspendLayout();
|
||||||
@@ -157,20 +156,6 @@
|
|||||||
this.lblSelectedColor.TabIndex = 1;
|
this.lblSelectedColor.TabIndex = 1;
|
||||||
this.lblSelectedColor.Text = "Hex:FFFFFF R:255 G:255 B:255";
|
this.lblSelectedColor.Text = "Hex:FFFFFF R:255 G:255 B:255";
|
||||||
//
|
//
|
||||||
// btnImportImage
|
|
||||||
//
|
|
||||||
this.btnImportImage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.btnImportImage.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(41)))), ((int)(((byte)(41)))));
|
|
||||||
this.btnImportImage.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
|
|
||||||
this.btnImportImage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(214)))), ((int)(((byte)(214)))), ((int)(((byte)(214)))));
|
|
||||||
this.btnImportImage.Location = new System.Drawing.Point(750, 606);
|
|
||||||
this.btnImportImage.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
|
||||||
this.btnImportImage.Name = "btnImportImage";
|
|
||||||
this.btnImportImage.Size = new System.Drawing.Size(171, 48);
|
|
||||||
this.btnImportImage.TabIndex = 6;
|
|
||||||
this.btnImportImage.Text = "Import Image";
|
|
||||||
this.btnImportImage.UseVisualStyleBackColor = false;
|
|
||||||
//
|
|
||||||
// panelFile
|
// panelFile
|
||||||
//
|
//
|
||||||
this.panelFile.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(31)))), ((int)(((byte)(31)))));
|
this.panelFile.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(31)))), ((int)(((byte)(31)))));
|
||||||
@@ -603,6 +588,34 @@
|
|||||||
this.panelTools.Size = new System.Drawing.Size(163, 593);
|
this.panelTools.Size = new System.Drawing.Size(163, 593);
|
||||||
this.panelTools.TabIndex = 31;
|
this.panelTools.TabIndex = 31;
|
||||||
//
|
//
|
||||||
|
// btnRedo
|
||||||
|
//
|
||||||
|
this.btnRedo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(41)))), ((int)(((byte)(41)))));
|
||||||
|
this.btnRedo.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
|
||||||
|
this.btnRedo.Font = new System.Drawing.Font("Cascadia Code", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.btnRedo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(214)))), ((int)(((byte)(214)))), ((int)(((byte)(214)))));
|
||||||
|
this.btnRedo.Location = new System.Drawing.Point(85, 547);
|
||||||
|
this.btnRedo.Name = "btnRedo";
|
||||||
|
this.btnRedo.Size = new System.Drawing.Size(75, 43);
|
||||||
|
this.btnRedo.TabIndex = 36;
|
||||||
|
this.btnRedo.Text = "Redo";
|
||||||
|
this.btnRedo.UseVisualStyleBackColor = false;
|
||||||
|
this.btnRedo.Click += new System.EventHandler(this.btnRedo_Click);
|
||||||
|
//
|
||||||
|
// btnUndo
|
||||||
|
//
|
||||||
|
this.btnUndo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(41)))), ((int)(((byte)(41)))));
|
||||||
|
this.btnUndo.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
|
||||||
|
this.btnUndo.Font = new System.Drawing.Font("Cascadia Code", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.btnUndo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(214)))), ((int)(((byte)(214)))), ((int)(((byte)(214)))));
|
||||||
|
this.btnUndo.Location = new System.Drawing.Point(3, 547);
|
||||||
|
this.btnUndo.Name = "btnUndo";
|
||||||
|
this.btnUndo.Size = new System.Drawing.Size(75, 43);
|
||||||
|
this.btnUndo.TabIndex = 35;
|
||||||
|
this.btnUndo.Text = "Undo";
|
||||||
|
this.btnUndo.UseVisualStyleBackColor = false;
|
||||||
|
this.btnUndo.Click += new System.EventHandler(this.btnUndo_Click);
|
||||||
|
//
|
||||||
// btnRandomColor
|
// btnRandomColor
|
||||||
//
|
//
|
||||||
this.btnRandomColor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(41)))), ((int)(((byte)(41)))));
|
this.btnRandomColor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(41)))), ((int)(((byte)(41)))));
|
||||||
@@ -640,34 +653,6 @@
|
|||||||
this.lsbTools.TabIndex = 32;
|
this.lsbTools.TabIndex = 32;
|
||||||
this.lsbTools.SelectedIndexChanged += new System.EventHandler(this.lsbTools_SelectedIndexChanged);
|
this.lsbTools.SelectedIndexChanged += new System.EventHandler(this.lsbTools_SelectedIndexChanged);
|
||||||
//
|
//
|
||||||
// btnUndo
|
|
||||||
//
|
|
||||||
this.btnUndo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(41)))), ((int)(((byte)(41)))));
|
|
||||||
this.btnUndo.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
|
|
||||||
this.btnUndo.Font = new System.Drawing.Font("Cascadia Code", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
|
||||||
this.btnUndo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(214)))), ((int)(((byte)(214)))), ((int)(((byte)(214)))));
|
|
||||||
this.btnUndo.Location = new System.Drawing.Point(3, 547);
|
|
||||||
this.btnUndo.Name = "btnUndo";
|
|
||||||
this.btnUndo.Size = new System.Drawing.Size(75, 43);
|
|
||||||
this.btnUndo.TabIndex = 35;
|
|
||||||
this.btnUndo.Text = "Undo";
|
|
||||||
this.btnUndo.UseVisualStyleBackColor = false;
|
|
||||||
this.btnUndo.Click += new System.EventHandler(this.btnUndo_Click);
|
|
||||||
//
|
|
||||||
// btnRedo
|
|
||||||
//
|
|
||||||
this.btnRedo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(41)))), ((int)(((byte)(41)))));
|
|
||||||
this.btnRedo.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
|
|
||||||
this.btnRedo.Font = new System.Drawing.Font("Cascadia Code", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
|
||||||
this.btnRedo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(214)))), ((int)(((byte)(214)))), ((int)(((byte)(214)))));
|
|
||||||
this.btnRedo.Location = new System.Drawing.Point(85, 547);
|
|
||||||
this.btnRedo.Name = "btnRedo";
|
|
||||||
this.btnRedo.Size = new System.Drawing.Size(75, 43);
|
|
||||||
this.btnRedo.TabIndex = 36;
|
|
||||||
this.btnRedo.Text = "Redo";
|
|
||||||
this.btnRedo.UseVisualStyleBackColor = false;
|
|
||||||
this.btnRedo.Click += new System.EventHandler(this.btnRedo_Click);
|
|
||||||
//
|
|
||||||
// PaintForm
|
// PaintForm
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
|
||||||
@@ -680,7 +665,6 @@
|
|||||||
this.Controls.Add(this.panelDrawing);
|
this.Controls.Add(this.panelDrawing);
|
||||||
this.Controls.Add(this.panelFile);
|
this.Controls.Add(this.panelFile);
|
||||||
this.Controls.Add(this.btnClear);
|
this.Controls.Add(this.btnClear);
|
||||||
this.Controls.Add(this.btnImportImage);
|
|
||||||
this.Controls.Add(this.canvas);
|
this.Controls.Add(this.canvas);
|
||||||
this.Font = new System.Drawing.Font("Cascadia Code", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.Font = new System.Drawing.Font("Cascadia Code", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(214)))), ((int)(((byte)(214)))), ((int)(((byte)(214)))));
|
this.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(214)))), ((int)(((byte)(214)))), ((int)(((byte)(214)))));
|
||||||
@@ -716,7 +700,6 @@
|
|||||||
private System.Windows.Forms.Button btnSaveCopy;
|
private System.Windows.Forms.Button btnSaveCopy;
|
||||||
private System.Windows.Forms.Label label1;
|
private System.Windows.Forms.Label label1;
|
||||||
private System.Windows.Forms.Label lblSelectedColor;
|
private System.Windows.Forms.Label lblSelectedColor;
|
||||||
private System.Windows.Forms.Button btnImportImage;
|
|
||||||
private System.Windows.Forms.Panel panelFile;
|
private System.Windows.Forms.Panel panelFile;
|
||||||
private System.Windows.Forms.Label label10;
|
private System.Windows.Forms.Label label10;
|
||||||
private System.Windows.Forms.Panel panelDrawing;
|
private System.Windows.Forms.Panel panelDrawing;
|
||||||
|
|||||||
@@ -83,6 +83,11 @@ namespace Paint_2
|
|||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
Drawings = new List<List<Point>>();
|
Drawings = new List<List<Point>>();
|
||||||
|
DrawingsRedo = new List<List<Point>>();
|
||||||
|
Colors = new List<Color>();
|
||||||
|
ColorsRedo = new List<Color>();
|
||||||
|
Widths = new List<int>();
|
||||||
|
WidthsRedo = new List<int>();
|
||||||
}
|
}
|
||||||
public void Stop(Point point)
|
public void Stop(Point point)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user