From 78e040f5f6f3af0f4e66b84523f77fdfb819b8af Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Sat, 13 Jun 2015 12:30:32 +0200 Subject: [PATCH] LastPainted slot clipping rect! --- Tests/GOLIBTest_4.cs | 16 ++++++++-------- src/GraphicObjects/GraphicObject.cs | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Tests/GOLIBTest_4.cs b/Tests/GOLIBTest_4.cs index 35b2dcff..97e8c626 100644 --- a/Tests/GOLIBTest_4.cs +++ b/Tests/GOLIBTest_4.cs @@ -43,14 +43,14 @@ namespace test int oldVal = _fps; _fps = value; -// if (_fps > fpsMax) { -// fpsMax = _fps; -// ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax, _fps)); -// } else if (_fps < fpsMin) { -// ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin, _fps)); -// fpsMin = _fps; -// } -// + if (_fps > fpsMax) { + fpsMax = _fps; + ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax, _fps)); + } else if (_fps < fpsMin) { + ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin, _fps)); + fpsMin = _fps; + } + ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", oldVal, _fps)); } } diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 2c10a658..0944703f 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -364,10 +364,12 @@ namespace go } public Rectangle LastSlots; + public Rectangle LastPaintedSlot; public virtual void registerClipRect() { TopContainer.redrawClip.AddRectangle (ScreenCoordinates(Slot)); + TopContainer.redrawClip.AddRectangle (ScreenCoordinates(LastPaintedSlot)); } protected virtual Size measureRawSize () { @@ -567,6 +569,8 @@ namespace go protected virtual void UpdateGraphic () { + LastPaintedSlot = Slot; + int stride = 4 * Slot.Width; int bmpSize = Math.Abs (stride) * Slot.Height; -- 2.47.3