From b911830ddc2e532ce52ac195b2797ce7f29ffe8d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Fri, 6 Jan 2017 12:22:18 +0100 Subject: [PATCH] debug dirtyRect --- src/Interface.cs | 8 ++++---- 1 file 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; } -- 2.47.3