diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2017-01-06 12:22:18 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2017-01-06 12:22:18 +0100 |
| commit | b911830ddc2e532ce52ac195b2797ce7f29ffe8d (patch) | |
| tree | ba76900f1f171c08c6d3d13c39359aae5a9c06d6 /src | |
| parent | 40b16003066ad42604fd82dc0eec9cfa0a4abeca (diff) | |
debug dirtyRect
Diffstat (limited to 'src')
| -rw-r--r-- | src/Interface.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Interface.cs b/src/Interface.cs index 542cf2dd..6196c313 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -57,14 +57,14 @@ namespace Crow } public Interface(){ CurrentInterface = this; - CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture; + CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture; } #endregion #region Static and constants public static int DoubleClick = 200;//ms internal Stopwatch clickTimer = new Stopwatch(); - internal GraphicObject eligibleForDoubleClick = null; + internal GraphicObject eligibleForDoubleClick = null; public static int TabSize = 4; public static string LineBreak = "\r\n"; //TODO: shold be declared in graphicObject @@ -441,7 +441,6 @@ namespace Crow DirtyRect += clipping.Bounds; else DirtyRect = clipping.Bounds; - IsDirty = true; DirtyRect.Left = Math.Max (0, DirtyRect.Left); DirtyRect.Top = Math.Max (0, DirtyRect.Top); @@ -450,13 +449,14 @@ namespace Crow DirtyRect.Width = Math.Max (0, DirtyRect.Width); DirtyRect.Height = Math.Max (0, DirtyRect.Height); - if (DirtyRect.Width > 0) { + if (DirtyRect.Width > 0 && DirtyRect.Height >0) { dirtyBmp = new byte[4 * DirtyRect.Width * DirtyRect.Height]; for (int y = 0; y < DirtyRect.Height; y++) { Array.Copy (bmp, ((DirtyRect.Top + y) * ClientRectangle.Width * 4) + DirtyRect.Left * 4, dirtyBmp, y * DirtyRect.Width * 4, DirtyRect.Width * 4); } + IsDirty = true; } else IsDirty = false; } |