Skip to content
Snippets Groups Projects
Commit c8fa5319 authored by Pavle Arezina's avatar Pavle Arezina
Browse files

Negative values will not crash gif system

parent 7958eb3b
No related branches found
No related tags found
No related merge requests found
...@@ -66,10 +66,10 @@ namespace Gifitti.View_Models ...@@ -66,10 +66,10 @@ namespace Gifitti.View_Models
// //
// gifView // gifView
// //
this.gifView.Location = new System.Drawing.Point(12, 12); this.gifView.Location = new System.Drawing.Point(9, 10);
this.gifView.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.gifView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gifView.Name = "gifView"; this.gifView.Name = "gifView";
this.gifView.Size = new System.Drawing.Size(608, 470); this.gifView.Size = new System.Drawing.Size(456, 382);
this.gifView.TabIndex = 2; this.gifView.TabIndex = 2;
this.gifView.TabStop = false; this.gifView.TabStop = false;
// //
...@@ -151,10 +151,10 @@ namespace Gifitti.View_Models ...@@ -151,10 +151,10 @@ namespace Gifitti.View_Models
// //
this.textBox1.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.textBox1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.textBox1.Enabled = false; this.textBox1.Enabled = false;
this.textBox1.Location = new System.Drawing.Point(285, 567); this.textBox1.Location = new System.Drawing.Point(214, 461);
this.textBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.textBox1.Name = "textBox1"; this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(29, 22); this.textBox1.Size = new System.Drawing.Size(23, 20);
this.textBox1.TabIndex = 3; this.textBox1.TabIndex = 3;
this.textBox1.TextChanged += new System.EventHandler(this.StartFrameTextChanged); this.textBox1.TextChanged += new System.EventHandler(this.StartFrameTextChanged);
// //
...@@ -162,10 +162,10 @@ namespace Gifitti.View_Models ...@@ -162,10 +162,10 @@ namespace Gifitti.View_Models
// //
this.textBox2.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.textBox2.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.textBox2.Enabled = false; this.textBox2.Enabled = false;
this.textBox2.Location = new System.Drawing.Point(320, 567); this.textBox2.Location = new System.Drawing.Point(240, 461);
this.textBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBox2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.textBox2.Name = "textBox2"; this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(29, 22); this.textBox2.Size = new System.Drawing.Size(23, 20);
this.textBox2.TabIndex = 4; this.textBox2.TabIndex = 4;
this.textBox2.TextChanged += new System.EventHandler(this.StopFrameTextChanged); this.textBox2.TextChanged += new System.EventHandler(this.StopFrameTextChanged);
// //
...@@ -173,10 +173,10 @@ namespace Gifitti.View_Models ...@@ -173,10 +173,10 @@ namespace Gifitti.View_Models
// //
this.button3.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.button3.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.button3.Enabled = false; this.button3.Enabled = false;
this.button3.Location = new System.Drawing.Point(355, 564); this.button3.Location = new System.Drawing.Point(266, 458);
this.button3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.button3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.button3.Name = "button3"; this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(67, 30); this.button3.Size = new System.Drawing.Size(50, 24);
this.button3.TabIndex = 5; this.button3.TabIndex = 5;
this.button3.Text = "Stop"; this.button3.Text = "Stop";
this.button3.UseVisualStyleBackColor = true; this.button3.UseVisualStyleBackColor = true;
...@@ -186,9 +186,10 @@ namespace Gifitti.View_Models ...@@ -186,9 +186,10 @@ namespace Gifitti.View_Models
// //
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.label1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(282, 548); this.label1.Location = new System.Drawing.Point(212, 445);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(38, 17); this.label1.Size = new System.Drawing.Size(29, 13);
this.label1.TabIndex = 6; this.label1.TabIndex = 6;
this.label1.Text = "Start"; this.label1.Text = "Start";
// //
...@@ -196,9 +197,10 @@ namespace Gifitti.View_Models ...@@ -196,9 +197,10 @@ namespace Gifitti.View_Models
// //
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.label2.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(319, 548); this.label2.Location = new System.Drawing.Point(239, 445);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(33, 17); this.label2.Size = new System.Drawing.Size(26, 13);
this.label2.TabIndex = 7; this.label2.TabIndex = 7;
this.label2.Text = "End"; this.label2.Text = "End";
// //
...@@ -206,9 +208,10 @@ namespace Gifitti.View_Models ...@@ -206,9 +208,10 @@ namespace Gifitti.View_Models
// //
this.label3.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.label3.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(213, 561); this.label3.Location = new System.Drawing.Point(160, 456);
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(66, 34); this.label3.Size = new System.Drawing.Size(51, 26);
this.label3.TabIndex = 8; this.label3.TabIndex = 8;
this.label3.Text = "Frame \r\nSelection"; this.label3.Text = "Frame \r\nSelection";
// //
...@@ -220,9 +223,10 @@ namespace Gifitti.View_Models ...@@ -220,9 +223,10 @@ namespace Gifitti.View_Models
// trackBar1 // trackBar1
// //
this.trackBar1.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.trackBar1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.trackBar1.Location = new System.Drawing.Point(437, 561); this.trackBar1.Location = new System.Drawing.Point(328, 456);
this.trackBar1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.trackBar1.Name = "trackBar1"; this.trackBar1.Name = "trackBar1";
this.trackBar1.Size = new System.Drawing.Size(183, 56); this.trackBar1.Size = new System.Drawing.Size(137, 45);
this.trackBar1.TabIndex = 9; this.trackBar1.TabIndex = 9;
this.trackBar1.Value = 10; this.trackBar1.Value = 10;
this.trackBar1.ValueChanged += new System.EventHandler(this.GifFPSSliderUpdate); this.trackBar1.ValueChanged += new System.EventHandler(this.GifFPSSliderUpdate);
...@@ -231,9 +235,10 @@ namespace Gifitti.View_Models ...@@ -231,9 +235,10 @@ namespace Gifitti.View_Models
// //
this.label4.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.label4.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.label4.AutoSize = true; this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(478, 551); this.label4.Location = new System.Drawing.Point(358, 448);
this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(110, 17); this.label4.Size = new System.Drawing.Size(85, 13);
this.label4.TabIndex = 10; this.label4.TabIndex = 10;
this.label4.Text = "Playback Speed"; this.label4.Text = "Playback Speed";
// //
...@@ -243,17 +248,18 @@ namespace Gifitti.View_Models ...@@ -243,17 +248,18 @@ namespace Gifitti.View_Models
this.label6.AutoSize = true; this.label6.AutoSize = true;
this.label6.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.label6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F);
this.label6.Location = new System.Drawing.Point(87, 560); this.label6.Location = new System.Drawing.Point(65, 455);
this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label6.Name = "label6"; this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(96, 29); this.label6.Size = new System.Drawing.Size(72, 24);
this.label6.TabIndex = 12; this.label6.TabIndex = 12;
this.label6.Text = "GIFITTI"; this.label6.Text = "GIFITTI";
// //
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(632, 577); this.ClientSize = new System.Drawing.Size(474, 469);
this.Controls.Add(this.label6); this.Controls.Add(this.label6);
this.Controls.Add(this.label4); this.Controls.Add(this.label4);
this.Controls.Add(this.trackBar1); this.Controls.Add(this.trackBar1);
...@@ -264,7 +270,7 @@ namespace Gifitti.View_Models ...@@ -264,7 +270,7 @@ namespace Gifitti.View_Models
this.Controls.Add(this.textBox2); this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1); this.Controls.Add(this.textBox1);
this.Controls.Add(this.gifView); this.Controls.Add(this.gifView);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Menu = this.mainMenu1; this.Menu = this.mainMenu1;
this.Name = "MainForm"; this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
......
...@@ -178,7 +178,7 @@ namespace Gifitti.View_Models ...@@ -178,7 +178,7 @@ namespace Gifitti.View_Models
{ {
int start = 0; int start = 0;
bool pass = int.TryParse(textBox1.Text, out start); bool pass = int.TryParse(textBox1.Text, out start);
if (pass) if (pass & start >= 0)
{ {
gm.startFrame = start; gm.startFrame = start;
} }
...@@ -193,7 +193,7 @@ namespace Gifitti.View_Models ...@@ -193,7 +193,7 @@ namespace Gifitti.View_Models
{ {
int end = 0; int end = 0;
bool pass = int.TryParse(textBox2.Text, out end); bool pass = int.TryParse(textBox2.Text, out end);
if (pass) if (pass & end >= 0)
{ {
gm.endFrame = end; gm.endFrame = end;
} }
......
...@@ -61,7 +61,7 @@ namespace Gifitti.View_Models ...@@ -61,7 +61,7 @@ namespace Gifitti.View_Models
private void widthChanged(object sender, EventArgs e) private void widthChanged(object sender, EventArgs e)
{ {
int w = 0; int w = 0;
if (int.TryParse(WidthTextBox.Text, out w)){ if (int.TryParse(WidthTextBox.Text, out w) & w >= 0){
width = w; width = w;
} }
} }
...@@ -69,7 +69,7 @@ namespace Gifitti.View_Models ...@@ -69,7 +69,7 @@ namespace Gifitti.View_Models
private void heightChanged(object sender, EventArgs e) private void heightChanged(object sender, EventArgs e)
{ {
int h = 0; int h = 0;
if (int.TryParse(HeightTextBox.Text,out h)) if (int.TryParse(HeightTextBox.Text,out h) & h >= 0)
{ {
height = h; height = h;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment