]> O.S.I.I.S - jp/crow.git/commitdiff
remove save/restore in Interface and Widget.Paint, clip and clean before Cairo.PushTo... RemovedSomeSaveRestore
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 17 Jan 2021 19:24:09 +0000 (20:24 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 17 Jan 2021 22:07:55 +0000 (23:07 +0100)
Crow/src/Interface.cs
Crow/src/Widgets/Widget.cs

index 11417dec8e0832766add3e6e24ffe907633b46b1..f329f517ad7510d68dd8dd99a48ba1ef2667e152 100644 (file)
@@ -816,6 +816,13 @@ namespace Crow
                                PerformanceMeasure.Begin (PerformanceMeasure.Kind.Drawing);
                                IsDirty = true;
 
+                               for (int i = 0; i < clipping.NumRectangles; i++)
+                                       ctx.Rectangle (clipping.GetRectangle (i));
+                               ctx.ClipPreserve ();
+                               ctx.Operator = Operator.Clear;
+                               ctx.Fill ();
+                               ctx.Operator = Operator.Over;
+
                                ctx.PushGroup ();
 
                                for (int i = GraphicTree.Count -1; i >= 0 ; i--){
@@ -825,9 +832,9 @@ namespace Crow
                                        if (clipping.Contains (p.Slot) == RegionOverlap.Out)
                                                continue;
 
-                                       ctx.Save ();
+                                       //ctx.Save ();
                                        p.Paint (ref ctx);
-                                       ctx.Restore ();
+                                       //ctx.Restore ();
                                }
 
                                if (DragAndDropOperation != null) {
@@ -856,13 +863,10 @@ namespace Crow
 
                                ctx.PopGroupToSource ();
 
-                               for (int i = 0; i < clipping.NumRectangles; i++)
-                                       ctx.Rectangle (clipping.GetRectangle (i));
+/*                             for (int i = 0; i < clipping.NumRectangles; i++)
+                                       ctx.Rectangle (clipping.GetRectangle (i));*/
+
 
-                               ctx.ClipPreserve ();
-                               ctx.Operator = Operator.Clear;
-                               ctx.Fill ();
-                               ctx.Operator = Operator.Over;
 
                                ctx.Paint ();
                                        
index e76c807fcc1c72c16b1cc15b5dfeaebddc0f6b15..ecb3267f7a4bb92229e101048fcdd3f6c5059025 100644 (file)
@@ -1838,7 +1838,7 @@ namespace Crow
                                                paintDisabled (ctx, Slot + Parent.ClientRectangle.Position);                                    
                                } else {
                                        Rectangle rb = Slot + Parent.ClientRectangle.Position;
-                                       ctx.Save ();
+                                       //ctx.Save ();
 
                                        ctx.Translate (rb.X, rb.Y);
 
@@ -1846,7 +1846,8 @@ namespace Crow
                                        if (!IsEnabled)
                                                paintDisabled (ctx, Slot);
 
-                                       ctx.Restore ();
+                                       ctx.Translate (-rb.X, -rb.Y);
+                                       //ctx.Restore ();
                                }
                                LastPaintedSlot = Slot;
                        }