From 5a6b194c8bf644b224e2b6b30d2914c6ce914ad5 Mon Sep 17 00:00:00 2001 From: Nicolai Kozel <kozeln@mcmaster.ca> Date: Mon, 21 Nov 2016 12:36:34 -0500 Subject: [PATCH] fixing clone issue with resizing --- .../Gifitti/View_Models/MainForm.Designer.cs | 14 +++++++------- .../Gifitti/View_Models/SaveAsXbyYPrompt.cs | 9 +++++++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Gifitti/Gifitti/View_Models/MainForm.Designer.cs b/src/Gifitti/Gifitti/View_Models/MainForm.Designer.cs index 1244975..a9311e7 100644 --- a/src/Gifitti/Gifitti/View_Models/MainForm.Designer.cs +++ b/src/Gifitti/Gifitti/View_Models/MainForm.Designer.cs @@ -41,6 +41,7 @@ namespace Gifitti.View_Models this.PNG = new System.Windows.Forms.MenuItem(); this.BMP = new System.Windows.Forms.MenuItem(); this.TIFF = new System.Windows.Forms.MenuItem(); + this.menuResize = new System.Windows.Forms.MenuItem(); this.menuFileSaveAs = new System.Windows.Forms.MenuItem(); this.menuHelp = new System.Windows.Forms.MenuItem(); this.textBox1 = new System.Windows.Forms.TextBox(); @@ -54,7 +55,6 @@ namespace Gifitti.View_Models this.trackBar1 = new System.Windows.Forms.TrackBar(); this.label4 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); - this.menuResize = new System.Windows.Forms.MenuItem(); ((System.ComponentModel.ISupportInitialize)(this.gifView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); this.SuspendLayout(); @@ -129,6 +129,12 @@ namespace Gifitti.View_Models this.TIFF.Text = "TIFF"; this.TIFF.Click += new System.EventHandler(this.MenuItemExportTIFF); // + // menuResize + // + this.menuResize.Index = 2; + this.menuResize.Text = "Resize..."; + this.menuResize.Click += new System.EventHandler(this.MenuItemResize); + // // menuFileSaveAs // this.menuFileSaveAs.Index = 3; @@ -243,12 +249,6 @@ namespace Gifitti.View_Models this.label6.TabIndex = 12; this.label6.Text = "GIFITTI"; // - // menuResize - // - this.menuResize.Index = 2; - this.menuResize.Text = "Resize..."; - this.menuResize.Click += new System.EventHandler(this.MenuItemResize); - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); diff --git a/src/Gifitti/Gifitti/View_Models/SaveAsXbyYPrompt.cs b/src/Gifitti/Gifitti/View_Models/SaveAsXbyYPrompt.cs index dc2fe18..fc8dba7 100644 --- a/src/Gifitti/Gifitti/View_Models/SaveAsXbyYPrompt.cs +++ b/src/Gifitti/Gifitti/View_Models/SaveAsXbyYPrompt.cs @@ -16,14 +16,18 @@ namespace Gifitti.View_Models public partial class SaveAsXbyYPrompt : Form { GifModel gm; + int orignalWidth = 0; + int originalHeight = 0; int width = 0; int height = 0; public SaveAsXbyYPrompt(int width, int height, GifModel gm) { InitializeComponent(); - this.width = width; - this.height = height; + orignalWidth = width; + originalHeight = height; + this.width = orignalWidth; + this.height = originalHeight; WidthTextBox.Text = this.width.ToString(); HeightTextBox.Text = this.height.ToString(); this.gm = gm; //make this a clone @@ -50,6 +54,7 @@ namespace Gifitti.View_Models { MessageBox.Show("Save Path Invalid!"); } + TransformGif.resizeGif(gm, orignalWidth, originalHeight); this.Close(); } -- GitLab