diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-01-17 20:24:09 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-01-17 23:07:55 +0100 |
| commit | bc0182eb83e3f34acd311dfbfd73b6631ebf3da9 (patch) | |
| tree | a79a9a292264997109311460f5b3dc1ed2372751 | |
| parent | 58ccdfa8888760d5d3557a6268e7e3455cd2ad94 (diff) | |
remove save/restore in Interface and Widget.Paint, clip and clean before Cairo.PushToGoup(temp surf size depend on clipping)RemovedSomeSaveRestore
| -rw-r--r-- | Crow/src/Interface.cs | 20 | ||||
| -rw-r--r-- | Crow/src/Widgets/Widget.cs | 5 |
2 files changed, 15 insertions, 10 deletions
diff --git a/Crow/src/Interface.cs b/Crow/src/Interface.cs index 11417dec..f329f517 100644 --- a/Crow/src/Interface.cs +++ b/Crow/src/Interface.cs @@ -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 (); diff --git a/Crow/src/Widgets/Widget.cs b/Crow/src/Widgets/Widget.cs index e76c807f..ecb3267f 100644 --- a/Crow/src/Widgets/Widget.cs +++ b/Crow/src/Widgets/Widget.cs @@ -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; } |