From 96698e1d3a00679932bf3b0c4a30f9d91250eea0 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Tue, 3 Jan 2017 13:20:01 +0100 Subject: [PATCH] * Tests.csproj: update to opentk-2.0 * Enums.cs, Rectangle.cs, Rectangles.cs: Code clean * TemplatedGroup.cs: remove logicalParent in items loading --- Tests/Tests.csproj | 2 +- src/Enums.cs | 8 -------- src/GraphicObjects/TemplatedGroup.cs | 3 +-- src/Rectangle.cs | 29 +--------------------------- src/Rectangles.cs | 5 ----- 5 files changed, 3 insertions(+), 44 deletions(-) diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index e5d7ec71..c65b1d58 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -45,7 +45,7 @@ - $(SolutionDir)packages\OpenTK.Next.1.2.2336.6514-pre\lib\net20\OpenTK.dll + ..\packages\OpenTK.2.0.0\lib\net20\OpenTK.dll diff --git a/src/Enums.cs b/src/Enums.cs index 46f8cdab..07ae1a4d 100644 --- a/src/Enums.cs +++ b/src/Enums.cs @@ -35,12 +35,4 @@ namespace Crow Bottom, Center, } - - public enum RectanglesRelations - { - NoRelation, //nothing to do - Intersect, //clipped clear & repaint, no test - Contains, //clipped clear & repaint, test children - Equal //repaint, no test - } } diff --git a/src/GraphicObjects/TemplatedGroup.cs b/src/GraphicObjects/TemplatedGroup.cs index b05aad9f..772b89cf 100644 --- a/src/GraphicObjects/TemplatedGroup.cs +++ b/src/GraphicObjects/TemplatedGroup.cs @@ -390,6 +390,7 @@ namespace Crow lock (CurrentInterface.LayoutMutex) { g = iTemp.CreateInstance(CurrentInterface); page.AddChild (g); + //g.LogicalParent = this; registerItemClick (g); } @@ -397,8 +398,6 @@ namespace Crow (g as Expandable).Expand += iTemp.Expand; (g as Expandable).GetIsExpandable = iTemp.HasSubItems; } - //g.LogicalParent = this; - g.DataSource = data [i]; } diff --git a/src/Rectangle.cs b/src/Rectangle.cs index 3ceb396e..cc1aa56f 100644 --- a/src/Rectangle.cs +++ b/src/Rectangle.cs @@ -201,34 +201,7 @@ namespace Crow { return r1.TopLeft == r2.TopLeft && r1.Size == r2.Size ? false : true; } - #endregion - - public RectanglesRelations test(Rectangle r) - { - if (r == this) - return RectanglesRelations.Equal; - - int nbrPtIncluded = 0; - - if (this.ContainsOrIsEqual(r.TopLeft)) - nbrPtIncluded++; - if (this.ContainsOrIsEqual(r.TopRight)) - nbrPtIncluded++; - if (this.ContainsOrIsEqual(r.BottomLeft)) - nbrPtIncluded++; - if (this.ContainsOrIsEqual(r.BottomRight)) - nbrPtIncluded++; - - switch (nbrPtIncluded) - { - case 0: - return RectanglesRelations.NoRelation; - case 4: - return RectanglesRelations.Contains; - default: - return RectanglesRelations.Intersect; - } - } + #endregion public static readonly Rectangle Zero = new Rectangle(0, 0, 0, 0); public static Rectangle Empty diff --git a/src/Rectangles.cs b/src/Rectangles.cs index 9f3c3337..965b28c3 100644 --- a/src/Rectangles.cs +++ b/src/Rectangles.cs @@ -93,16 +93,11 @@ namespace Crow } public void clear(Context ctx) { - //ctx.Save(); - foreach (Rectangle r in list) - { ctx.Rectangle(r); - } ctx.Operator = Operator.Clear; ctx.Fill(); ctx.Operator = Operator.Over; - //ctx.Restore(); } public override string ToString () { -- 2.47.3