Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Commit

Permalink
[SharpDX] Don't call RenderForm.OnUserResized event when cachedSize i…
Browse files Browse the repository at this point in the history
…s empty
  • Loading branch information
Alexandre Mutel committed Feb 13, 2013
1 parent 1a2c6f7 commit 4e232e1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Source/SharpDX/Windows/RenderForm.cs
Expand Up @@ -45,6 +45,7 @@
#if !W8CORE
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace SharpDX.Windows
Expand Down Expand Up @@ -354,10 +355,14 @@ protected override void WndProc(ref Message m)

if (!sizeMove && (Size != cachedSize || previousWindowState == FormWindowState.Maximized))
{

previousWindowState = FormWindowState.Normal;
OnUserResized(EventArgs.Empty);
UpdateScreen();

// Only update when cachedSize is != 0
if (cachedSize != Size.Empty)
{
OnUserResized(EventArgs.Empty);
UpdateScreen();
}
cachedSize = Size;
}

Expand Down

0 comments on commit 4e232e1

Please sign in to comment.