From 1a91f87c9d08dd8940dbc62fa728a02500e092a3 Mon Sep 17 00:00:00 2001 From: Nielk1 Date: Fri, 16 Feb 2018 18:39:51 -0600 Subject: [PATCH] Attempted to fix memory leak in UL_Basic3D1 --- VSCView/MainForm.Designer.cs | 28 ++++++++++++++-------------- VSCView/OSD.cs | 8 ++++++++ VSCView/Properties/AssemblyInfo.cs | 4 ++-- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/VSCView/MainForm.Designer.cs b/VSCView/MainForm.Designer.cs index a6c878e..8f540d7 100644 --- a/VSCView/MainForm.Designer.cs +++ b/VSCView/MainForm.Designer.cs @@ -37,12 +37,12 @@ private void InitializeComponent() this.tsmiReloadThemes = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiReloadControllers = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.tsmiSetBackgroundColor = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiAbout = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.tsmiExit = new System.Windows.Forms.ToolStripMenuItem(); this.lblHint1 = new System.Windows.Forms.Label(); this.lblHint2 = new System.Windows.Forms.Label(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.tsmiSetBackgroundColor = new System.Windows.Forms.ToolStripMenuItem(); this.colorDialog1 = new System.Windows.Forms.ColorDialog(); this.cmsMain.SuspendLayout(); this.SuspendLayout(); @@ -105,6 +105,13 @@ private void InitializeComponent() this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(186, 6); // + // tsmiSetBackgroundColor + // + this.tsmiSetBackgroundColor.Name = "tsmiSetBackgroundColor"; + this.tsmiSetBackgroundColor.Size = new System.Drawing.Size(189, 22); + this.tsmiSetBackgroundColor.Text = "Set Background Color"; + this.tsmiSetBackgroundColor.Click += new System.EventHandler(this.tsmiSetBackgroundColor_Click); + // // tsmiAbout // this.tsmiAbout.Name = "tsmiAbout"; @@ -112,6 +119,11 @@ private void InitializeComponent() this.tsmiAbout.Text = "&About"; this.tsmiAbout.Click += new System.EventHandler(this.tsmiAbout_Click); // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(186, 6); + // // tsmiExit // this.tsmiExit.Name = "tsmiExit"; @@ -137,18 +149,6 @@ private void InitializeComponent() this.lblHint2.TabIndex = 2; this.lblHint2.Text = "Click and Drag to Move"; // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(186, 6); - // - // tsmiSetBackgroundColor - // - this.tsmiSetBackgroundColor.Name = "tsmiSetBackgroundColor"; - this.tsmiSetBackgroundColor.Size = new System.Drawing.Size(189, 22); - this.tsmiSetBackgroundColor.Text = "Set Background Color"; - this.tsmiSetBackgroundColor.Click += new System.EventHandler(this.tsmiSetBackgroundColor_Click); - // // colorDialog1 // this.colorDialog1.Color = System.Drawing.Color.Lime; diff --git a/VSCView/OSD.cs b/VSCView/OSD.cs index e2f738c..da8c2a0 100644 --- a/VSCView/OSD.cs +++ b/VSCView/OSD.cs @@ -921,10 +921,14 @@ private void Draw3dAs3d( { if (Math.Sign(TiltFactorX) > 0) { float percent = TiltFactorX * 2;// * 0.15f; + percent = (float)Math.Round(percent * 25f) / 25f; + percent = (float)Math.Min(percent, 1.0f); g.DrawImage(cache.GetImage($"{ImageGyroDName}:{percent}", () => { return UI_ImageCache.SetImageOpacity(ImageGyroD, percent); }), location.X, location.Y, Width, Height); } if (Math.Sign(TiltFactorX) < 0) { float percent = -TiltFactorX * 2;// * 0.15f; + percent = (float)Math.Round(percent * 25f) / 25f; + percent = (float)Math.Min(percent, 1.0f); g.DrawImage(cache.GetImage($"{ImageGyroUName}:{percent}", () => { return UI_ImageCache.SetImageOpacity(ImageGyroU, percent); }), location.X, location.Y, Width, Height); } } @@ -933,10 +937,14 @@ private void Draw3dAs3d( { if (Math.Sign(TiltFactorY) > 0) { float percent = TiltFactorY * 2;// * 0.15f; + percent = (float)Math.Round(percent * 25f) / 25f; + percent = (float)Math.Min(percent, 1.0f); g.DrawImage(cache.GetImage($"{ImageGyroLName}:{percent}", () => { return UI_ImageCache.SetImageOpacity(ImageGyroL, percent); }), location.X, location.Y, Width, Height); } if (Math.Sign(TiltFactorY) < 0) { float percent = -TiltFactorY * 2;// * 0.15f; + percent = (float)Math.Round(percent * 25f) / 25f; + percent = (float)Math.Min(percent, 1.0f); g.DrawImage(cache.GetImage($"{ImageGyroRName}:{percent}", () => { return UI_ImageCache.SetImageOpacity(ImageGyroR, percent); }), location.X, location.Y, Width, Height); } } diff --git a/VSCView/Properties/AssemblyInfo.cs b/VSCView/Properties/AssemblyInfo.cs index a4a3cbb..b211ba6 100644 --- a/VSCView/Properties/AssemblyInfo.cs +++ b/VSCView/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.3.0.4")] -[assembly: AssemblyFileVersion("0.3.0.4")] +[assembly: AssemblyVersion("0.3.1.4")] +[assembly: AssemblyFileVersion("0.3.1.4")]