[gbrainy] Update calls to deprecated Cairo properties



commit bd6c1f84f88362d8785d8505fc844da7a3deb0b7
Author: Jordi Mas <jmas softcatala org>
Date:   Thu Jan 10 09:54:23 2019 +0100

    Update calls to deprecated Cairo properties

 src/Clients/Classical/Widgets/GameDrawingArea.cs |  6 ++--
 src/Core/Libraries/CairoContext.cs               |  4 +--
 src/Core/Main/CairoContextEx.cs                  |  2 +-
 src/Core/Main/Game.cs                            |  2 +-
 src/Core/Main/Memory.cs                          | 10 +++----
 src/Core/Toolkit/DrawableArea.cs                 |  2 +-
 src/Core/Views/CountDownView.cs                  |  2 +-
 src/Core/Views/FinishView.cs                     |  6 ++--
 src/Core/Views/PlayerHistoryView.cs              | 36 ++++++++++++------------
 src/Core/Views/WelcomeView.cs                    |  2 +-
 src/Games/Logic/PuzzleCoverPercentage.cs         |  1 -
 src/Games/Logic/PuzzleGridCircles.cs             |  2 +-
 src/Games/Logic/PuzzleSquareSheets.cs            |  8 +++---
 src/Games/Memory/MemoryColouredText.cs           |  2 +-
 src/Games/Memory/MemoryCountDots.cs              |  2 +-
 src/Games/Memory/MemoryFaces.cs                  |  6 ++--
 src/Games/Memory/MemoryFiguresAndText.cs         |  6 ++--
 17 files changed, 49 insertions(+), 50 deletions(-)
---
diff --git a/src/Clients/Classical/Widgets/GameDrawingArea.cs 
b/src/Clients/Classical/Widgets/GameDrawingArea.cs
index 55400bc..131b4b2 100644
--- a/src/Clients/Classical/Widgets/GameDrawingArea.cs
+++ b/src/Clients/Classical/Widgets/GameDrawingArea.cs
@@ -130,7 +130,7 @@ namespace gbrainy.Clients.Classical.Widgets
                                // Draw the game area
                                cr.Translate (OffsetX, OffsetY);
                                cr.SetPangoNormalFontSize ();
-                               cr.Color = new Cairo.Color (1, 1, 1, 0.5);
+                               cr.SetSourceColor (new Cairo.Color (1, 1, 1, 0.5));
                                Drawable.Draw (cr, DrawingSquare, DrawingSquare, Direction == 
Gtk.TextDirection.Rtl);
                                cr.Stroke ();
                        }
@@ -197,7 +197,7 @@ namespace gbrainy.Clients.Classical.Widgets
                        box_height_scaled = Math.Max (height_str, (double) solution_high / (double) height);
 
                        // Draw black box
-                       cr.Color = new Cairo.Color (0.1, 0.1, 0.1);
+                       cr.SetSourceColor (new Cairo.Color (0.1, 0.1, 0.1));
 
                        cr.Rectangle (text_margin,
                                1 - box_height_scaled - text_margin,
@@ -207,7 +207,7 @@ namespace gbrainy.Clients.Classical.Widgets
                        cr.Stroke ();
 
                        // Draw text and icon
-                       cr.Color = new Cairo.Color (1, 1, 1);
+                       cr.SetSourceColor (new Cairo.Color (1, 1, 1));
 
                        if (Direction == Gtk.TextDirection.Rtl)
                        {
diff --git a/src/Core/Libraries/CairoContext.cs b/src/Core/Libraries/CairoContext.cs
index 544052c..bc410ec 100644
--- a/src/Core/Libraries/CairoContext.cs
+++ b/src/Core/Libraries/CairoContext.cs
@@ -35,7 +35,7 @@ namespace gbrainy.Core.Libraries
                const double def_linespace = 0.018;
                const double width_margin = 0.04;
 
-               public CairoContext (IntPtr handle) : base (handle)
+               public CairoContext (IntPtr handle) : base (handle, true)
                {
                        layout = Pango.CairoHelper.CreateLayout (this);
                        FontLineSpace = def_linespace;
@@ -264,7 +264,7 @@ namespace gbrainy.Core.Libraries
                        LinearGradient shadow = new LinearGradient (x, y, x + w, y + h);
                        shadow.AddColorStop (0, new Cairo.Color (color.R, color.G, color.B, color.A));
                        shadow.AddColorStop (0.5, new Cairo.Color (color.R, color.G, color.B, color.A * 0.7));
-                       Source = shadow;
+                       SetSource (shadow);
                        Fill ();
                        Restore ();
                        ((IDisposable)shadow).Dispose ();
diff --git a/src/Core/Main/CairoContextEx.cs b/src/Core/Main/CairoContextEx.cs
index 6299644..0ec9bbd 100644
--- a/src/Core/Main/CairoContextEx.cs
+++ b/src/Core/Main/CairoContextEx.cs
@@ -129,7 +129,7 @@ namespace gbrainy.Core.Main
                        LinearGradient shadow = new LinearGradient (x, y, x + w, y + h);
                        shadow.AddColorStop (0, new Cairo.Color (0, 0, 0, 0.3));
                        shadow.AddColorStop (0.5, new Cairo.Color (0, 0, 0, 0.1));
-                       Source = shadow;
+                       SetSource(shadow);
                        Fill ();
                        Restore ();
                        ((IDisposable)shadow).Dispose ();
diff --git a/src/Core/Main/Game.cs b/src/Core/Main/Game.cs
index 318a1ab..650ed9e 100644
--- a/src/Core/Main/Game.cs
+++ b/src/Core/Main/Game.cs
@@ -277,7 +277,7 @@ namespace gbrainy.Core.Main
                protected void InitDraw (CairoContextEx gr, int width, int height, bool rtl)
                {
                        gr.Scale (width, height);
-                       gr.Color = default_color;
+                       gr.SetSourceColor (default_color);
                        gr.LineWidth = LineWidth;
                        // Not all Cairo surfaces have a default font size (like PDF)
                        gr.SetPangoNormalFontSize ();
diff --git a/src/Core/Main/Memory.cs b/src/Core/Main/Memory.cs
index 5216e73..b86cca3 100644
--- a/src/Core/Main/Memory.cs
+++ b/src/Core/Main/Memory.cs
@@ -189,13 +189,13 @@ namespace gbrainy.Core.Main
                                if (alpha > 0)
                                        alpha -= (1 / (double) shading_time);
 
-                               gr.Color = new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, alpha);
+                               gr.SetSourceColor (new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, alpha));
                                DrawObjectToMemorize (gr, area_width, area_height, rtl);
                                return;
                        }
                
                        alpha = 1;
-                       gr.Color = new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, alpha);
+                       gr.SetSourceColor (new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, alpha));
                        if (request_answer && Answer.Draw == false) {
                                DrawPossibleAnswers (gr, area_width, area_height, rtl);
                        } else {
@@ -206,7 +206,7 @@ namespace gbrainy.Core.Main
                public override void DrawPreview (CairoContextEx gr, int width, int height, bool rtl)
                {
                        gr.Scale (width, height);
-                       gr.Color = new Cairo.Color (0, 0, 0);
+                       gr.SetSourceColor (new Cairo.Color (0, 0, 0));
                        gr.LineWidth = LineWidth;
                        DrawObjectToMemorize (gr, width, height, rtl);
                }
@@ -237,7 +237,7 @@ namespace gbrainy.Core.Main
                        gr.Stroke ();
 
                        gr.Save ();
-                       gr.Color = new Color (0, 0, 0); 
+                       gr.SetSourceColor (new Color (0, 0, 0));
                        gr.MoveTo (x, y);
                        gr.LineTo (x, y + height);
                        gr.LineTo (x + width, y + height);
@@ -258,7 +258,7 @@ namespace gbrainy.Core.Main
                                gradient.AddColorStop (1, new Color (0.2, 0, 0, 1));
                        }
 
-                       gr.Source = gradient;                   
+                       gr.SetSource (gradient);
                        gr.MoveTo (x, y);
                        gr.LineTo (x, y + height);
                        gr.LineTo (x + width, y + height);
diff --git a/src/Core/Toolkit/DrawableArea.cs b/src/Core/Toolkit/DrawableArea.cs
index 26ce44f..ebe1848 100644
--- a/src/Core/Toolkit/DrawableArea.cs
+++ b/src/Core/Toolkit/DrawableArea.cs
@@ -65,7 +65,7 @@ namespace gbrainy.Core.Toolkit
 
                                gr.Save ();
 
-                               gr.Color = new Cairo.Color (0.5, 0.5, 0.5, 1);
+                               gr.SetSourceColor (new Cairo.Color (0.5, 0.5, 0.5, 1));
                                gr.SetDash (dashes, 0);
 
                                if (SelectedArea.Width == 0 && SelectedArea.Height == 0)
diff --git a/src/Core/Views/CountDownView.cs b/src/Core/Views/CountDownView.cs
index 7b2847c..64d665e 100644
--- a/src/Core/Views/CountDownView.cs
+++ b/src/Core/Views/CountDownView.cs
@@ -72,7 +72,7 @@ namespace gbrainy.Core.Views
                        gr.Scale (area_width, area_height);
 
                        gr.LineWidth = 0.01;
-                       gr.Color = new Cairo.Color (0, 0, 0, 1);
+                       gr.SetSourceColor (new Cairo.Color (0, 0, 0, 1));
 
                        gr.SetPangoLargeFontSize ();
                        gr.DrawTextCentered (0.5, 0.1, Translations.GetString ("Get ready to memorize the 
next objects..."));
diff --git a/src/Core/Views/FinishView.cs b/src/Core/Views/FinishView.cs
index f0e4ca4..7ba1d1c 100644
--- a/src/Core/Views/FinishView.cs
+++ b/src/Core/Views/FinishView.cs
@@ -50,7 +50,7 @@ namespace gbrainy.Core.Views
                {
                        gr.Save ();
                        gr.Rectangle (x, y, 1 - 0.06, 0.06);
-                       gr.Color = new Cairo.Color (0, 0, 0.2, 0.2);
+                       gr.SetSourceColor (new Cairo.Color (0, 0, 0.2, 0.2));
                        gr.Fill ();
                        gr.Restore ();          
                }
@@ -64,7 +64,7 @@ namespace gbrainy.Core.Views
                        gr.DrawTextCentered (x + w / 2, (y - 0.03) - h * per, String.Format ("{0}", 
percentage));
 
                        gr.Save ();
-                       gr.Color = new Cairo.Color (0, 0, 0);   
+                       gr.SetSourceColor (new Cairo.Color (0, 0, 0));
                        gr.MoveTo (x, y);
                        gr.LineTo (x, y - h * per);
                        gr.LineTo (x + w, y - h * per);
@@ -137,7 +137,7 @@ namespace gbrainy.Core.Views
                        double width, height;
 
                        gr.Scale (area_width, area_height);
-                       gr.Color = new Cairo.Color (0, 0, 0, 1);
+                       gr.SetSourceColor (new Cairo.Color (0, 0, 0, 1));
 
                        gr.MoveTo (x, y);
                        gr.ShowPangoText (Translations.GetString ("Score"), false, -1, 0);
diff --git a/src/Core/Views/PlayerHistoryView.cs b/src/Core/Views/PlayerHistoryView.cs
index c0248db..d703a1e 100644
--- a/src/Core/Views/PlayerHistoryView.cs
+++ b/src/Core/Views/PlayerHistoryView.cs
@@ -59,7 +59,7 @@ namespace gbrainy.Core.Views
                void DrawAxisDescription (CairoContextEx cr, double x, double y, string description)
                {
                        cr.Save ();
-                       cr.Color = desc_color;
+                       cr.SetSourceColor (desc_color);
                        cr.MoveTo (x, y);
                        cr.ShowPangoText (description);
                        cr.Stroke ();
@@ -74,49 +74,49 @@ namespace gbrainy.Core.Views
                        old_width = cr.LineWidth;
                        cr.LineWidth = 0.01;
 
-                       cr.Color = total_color;
+                       cr.SetSourceColor (total_color);
                        cr.MoveTo (x, y);
                        cr.LineTo (x + line_size, y);
                        cr.Stroke ();
-                       cr.Color = text_color;
+                       cr.SetSourceColor (text_color);
                        cr.MoveTo (x + line_size + offset_x, y - 0.01);
                        cr.ShowPangoText (Translations.GetString ("Total"));
                        cr.Stroke ();
 
-                       cr.Color = logic_color;
+                       cr.SetSourceColor (logic_color);
                        cr.MoveTo (x, y + second_row);
                        cr.LineTo (x + line_size, y + second_row);
                        cr.Stroke ();
-                       cr.Color = text_color;
+                       cr.SetSourceColor (text_color);
                        cr.MoveTo (x + line_size + offset_x, y - 0.01 + second_row);
                        cr.ShowPangoText (GameTypesDescription.GetLocalized (Translations, 
GameTypes.LogicPuzzle));
                        cr.Stroke ();
 
                        x += space_hor;
-                       cr.Color = memory_color;
+                       cr.SetSourceColor (memory_color);
                        cr.MoveTo (x, y);
                        cr.LineTo (x + line_size, y);
                        cr.Stroke ();
-                       cr.Color = text_color;
+                       cr.SetSourceColor (text_color);
                        cr.MoveTo (x + line_size + offset_x, y - 0.01);
                        cr.ShowPangoText (GameTypesDescription.GetLocalized (Translations, GameTypes.Memory));
                        cr.Stroke ();
 
-                       cr.Color = math_color;
+                       cr.SetSourceColor (math_color);
                        cr.MoveTo (x, y + second_row);
                        cr.LineTo (x + line_size, y + second_row);
                        cr.Stroke ();
-                       cr.Color = text_color;
+                       cr.SetSourceColor (text_color);
                        cr.MoveTo (x + line_size + offset_x, y - 0.01 + second_row);
                        cr.ShowPangoText (GameTypesDescription.GetLocalized (Translations, 
GameTypes.Calculation));
                        cr.Stroke ();
 
                        x += space_hor;
-                       cr.Color = verbal_color;
+                       cr.SetSourceColor (verbal_color);
                        cr.MoveTo (x, y);
                        cr.LineTo (x + line_size, y);
                        cr.Stroke ();
-                       cr.Color = text_color;
+                       cr.SetSourceColor (text_color);
                        cr.MoveTo (x + line_size + offset_x, y - 0.01);
                        cr.ShowPangoText (GameTypesDescription.GetLocalized (Translations, 
GameTypes.VerbalAnalogy));
                        cr.Stroke ();
@@ -136,7 +136,7 @@ namespace gbrainy.Core.Views
                        ratio = grid_width / (history.Games.Count - 1);
 
                        if (ShowLogic) {
-                               cr.Color = logic_color;
+                               cr.SetSourceColor (logic_color);
                                cr.MoveTo (x, grid_height - (grid_height * history.Games[0].LogicScore / 
100));
 
                                pos = 1;
@@ -154,7 +154,7 @@ namespace gbrainy.Core.Views
                        }
 
                        if (ShowCalculation) {
-                               cr.Color = math_color;
+                               cr.SetSourceColor (math_color);
                                cr.MoveTo (x, grid_height - (grid_height * history.Games[0].MathScore / 100));
 
                                pos = 1;
@@ -172,7 +172,7 @@ namespace gbrainy.Core.Views
                        }
 
                        if (ShowMemory) {
-                               cr.Color = memory_color;
+                               cr.SetSourceColor (memory_color);
                                cr.MoveTo (x, grid_height - (grid_height * history.Games[0].MemoryScore / 
100));
 
                                pos = 1;
@@ -190,7 +190,7 @@ namespace gbrainy.Core.Views
                        }
 
                        if (ShowVerbal) {
-                               cr.Color = verbal_color;
+                               cr.SetSourceColor (verbal_color);
                                cr.MoveTo (x, grid_height - (grid_height * history.Games[0].VerbalScore / 
100));
 
                                pos = 1;
@@ -208,7 +208,7 @@ namespace gbrainy.Core.Views
                        }
 
                        if (ShowTotal) {
-                               cr.Color = total_color;
+                               cr.SetSourceColor (total_color);
                                cr.MoveTo (x, grid_height - (grid_height * history.Games[0].TotalScore / 
100));
 
                                pos = 1;
@@ -235,7 +235,7 @@ namespace gbrainy.Core.Views
                        cr.Stroke ();
 
                        cr.Save ();
-                       cr.Color = axis_color;
+                       cr.SetSourceColor (axis_color);
                        cr.LineWidth = 0.001;
 
                        for (double line_y = y; line_y < grid_height + y; line_y += grid_height / 10) {
@@ -259,7 +259,7 @@ namespace gbrainy.Core.Views
                        double x = 0, y = 0;
 
                        // Background
-                       cr.Color = new Cairo.Color (1, 1, 1);
+                       cr.SetSourceColor (new Cairo.Color (1, 1, 1));
                        cr.Paint ();
                        cr.Stroke ();
 
diff --git a/src/Core/Views/WelcomeView.cs b/src/Core/Views/WelcomeView.cs
index 1bd7f81..fbb7b0d 100644
--- a/src/Core/Views/WelcomeView.cs
+++ b/src/Core/Views/WelcomeView.cs
@@ -134,7 +134,7 @@ namespace gbrainy.Core.Views
                        gr.Scale (area_width, area_height);
                        gr.LineWidth = 0.005;
 
-                       gr.Color = new Cairo.Color (0, 0, 0, 1);
+                       gr.SetSourceColor (new Cairo.Color (0, 0, 0, 1));
 
                        gr.MoveTo (0.05, y);
                        // Translators: {0} is the version number of the program
diff --git a/src/Games/Logic/PuzzleCoverPercentage.cs b/src/Games/Logic/PuzzleCoverPercentage.cs
index a9f7af9..d00d73e 100644
--- a/src/Games/Logic/PuzzleCoverPercentage.cs
+++ b/src/Games/Logic/PuzzleCoverPercentage.cs
@@ -94,7 +94,6 @@ namespace gbrainy.Games.Logic
                        gr.Stroke ();
 
                        gr.Save ();
-                       gr.Color = new Cairo.Color (0.90, 0.90, 0.90);
                        for (int i = 0; i < partial_zones; i++) {
                                Fill (gr, x + line_width, line_width + y, 
                                        (w / 2) - (line_width * 2) , (h / 5) - (line_width * 2));
diff --git a/src/Games/Logic/PuzzleGridCircles.cs b/src/Games/Logic/PuzzleGridCircles.cs
index a99d2c5..4cc510b 100644
--- a/src/Games/Logic/PuzzleGridCircles.cs
+++ b/src/Games/Logic/PuzzleGridCircles.cs
@@ -124,7 +124,7 @@ namespace gbrainy.Games.Logic
                                        {
                                                Number num = (Number) e.Data;
 
-                                               e.Context.Color = DefaultDrawingColor;
+                                               e.Context.SetSourceColor (DefaultDrawingColor);
                                                e.Context.Rectangle (0, 0, e.Width, e.Height);
                                                e.Context.Stroke ();
 
diff --git a/src/Games/Logic/PuzzleSquareSheets.cs b/src/Games/Logic/PuzzleSquareSheets.cs
index 2a140c7..7079b2d 100644
--- a/src/Games/Logic/PuzzleSquareSheets.cs
+++ b/src/Games/Logic/PuzzleSquareSheets.cs
@@ -79,13 +79,13 @@ namespace gbrainy.Games.Logic
                        gr.Save ();
 
                        // A full sized square of paper
-                       gr.Color = palette.Cairo (ColorPalette.Id.Yellow);
+                       gr.SetSourceColor (palette.Cairo (ColorPalette.Id.Yellow));
                        gr.Rectangle (x, y, width, height);
                        gr.Fill ();
                        gr.Stroke ();
 
                        // 3/4 of the whole size square of paper in the bottom right corner
-                       gr.Color = palette.Cairo (ColorPalette.Id.Blue);
+                       gr.SetSourceColor (palette.Cairo (ColorPalette.Id.Blue));
                        double w = 3d/4d * width;
                        double h = 3d/4d * height;
                        gr.Rectangle (x + (width - w), y + (height - h), w, h);
@@ -93,13 +93,13 @@ namespace gbrainy.Games.Logic
                        gr.Stroke ();
 
                        // 3/4 square of paper in the top left corner
-                       gr.Color = palette.Cairo (ColorPalette.Id.Green);
+                       gr.SetSourceColor (palette.Cairo (ColorPalette.Id.Green));
                        gr.Rectangle (x, y, 3d/4d * width, 3d/4d * height);
                        gr.Fill ();
                        gr.Stroke ();
                        
                        // 1/4 square of paper in the top left corner
-                       gr.Color = palette.Cairo (ColorPalette.Id.Red);
+                       gr.SetSourceColor (palette.Cairo (ColorPalette.Id.Red));
                        gr.Rectangle (x, y, 1d/4d * width, 1d/4d * height);
                        gr.Fill ();
                        gr.Stroke ();
diff --git a/src/Games/Memory/MemoryColouredText.cs b/src/Games/Memory/MemoryColouredText.cs
index c0948bb..b66dfa1 100644
--- a/src/Games/Memory/MemoryColouredText.cs
+++ b/src/Games/Memory/MemoryColouredText.cs
@@ -97,7 +97,7 @@ namespace gbrainy.Games.Memory
                        for (int i = 0; i < colors_shown; i++)
                        {
                                idx = color_order [i];
-                               gr.Color = palette.Cairo (idx);
+                               gr.SetSourceColor (palette.Cairo (idx));
                                gr.MoveTo (x, y);
                                gr.ShowPangoText (palette.Name (i));
                                gr.Stroke ();
diff --git a/src/Games/Memory/MemoryCountDots.cs b/src/Games/Memory/MemoryCountDots.cs
index 0b293a8..f037aba 100644
--- a/src/Games/Memory/MemoryCountDots.cs
+++ b/src/Games/Memory/MemoryCountDots.cs
@@ -99,7 +99,7 @@ namespace gbrainy.Games.Memory
                        palette.Alpha = alpha;
                        double x = DrawAreaX + 0.15, y = DrawAreaY + 0.1;
 
-                       gr.Color = palette.Cairo (ColorPalette.Id.Black);
+                       gr.SetSourceColor (palette.Cairo (ColorPalette.Id.Black));
                        double pos_x = x, pos_y = y;
                        const double figure_size = 0.6;
                        const double square_size = figure_size / NUMCOLUMNS ;
diff --git a/src/Games/Memory/MemoryFaces.cs b/src/Games/Memory/MemoryFaces.cs
index b74db0e..1d050df 100644
--- a/src/Games/Memory/MemoryFaces.cs
+++ b/src/Games/Memory/MemoryFaces.cs
@@ -149,7 +149,7 @@ namespace gbrainy.Games.Memory
 
                public override void DrawPossibleAnswers (CairoContextEx gr, int area_width, int area_height, 
bool rtl)
                {
-                       gr.Color = new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, 1);
+                       gr.SetSourceColor (new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, 1));
 
                        if (Answer.Draw ==  true) {
                                DrawAllFigures (gr, start_x_ans, start_y);
@@ -172,7 +172,7 @@ namespace gbrainy.Games.Memory
                        double org_x = x;
 
                        DrawGrid (gr, x, y);
-                       gr.Color = new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, alpha);
+                       gr.SetSourceColor (new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, alpha));
                        for (int figure = 0; figure < figures.Count; figure++, col++)
                        {
                                fig = figures[figure];
@@ -226,7 +226,7 @@ namespace gbrainy.Games.Memory
 
                private void DrawGrid (CairoContextEx gr, double x, double y)
                {
-                       gr.Color = new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, alpha);
+                       gr.SetSourceColor (new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, alpha));
                        for (int column = 0; column < columns; column++) {
                                for (int row = 0; row < rows; row++) {
                                        gr.Rectangle (x + column * rect_w, y + row * rect_h, rect_w, rect_h);
diff --git a/src/Games/Memory/MemoryFiguresAndText.cs b/src/Games/Memory/MemoryFiguresAndText.cs
index ee4fd7b..3b76627 100644
--- a/src/Games/Memory/MemoryFiguresAndText.cs
+++ b/src/Games/Memory/MemoryFiguresAndText.cs
@@ -185,7 +185,7 @@ namespace gbrainy.Games.Memory
                {
                        double x= DrawAreaX, y = DrawAreaY + 0.085;
                        int pos = 0;
-                       gr.Color = new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, 1);
+                       gr.SetSourceColor (new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, 1));
 
                        if (Answer.Draw ==  true) {
                                DrawAllFigures (gr, start_x_ans, start_y);
@@ -233,7 +233,7 @@ namespace gbrainy.Games.Memory
                        double org_x = x;
 
                        DrawGrid (gr, x, y);
-                       gr.Color = new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, alpha);
+                       gr.SetSourceColor (new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, alpha));
                        for (int figure = 0; figure < figures.Length; figure++, col++)
                        {
                                fig = figures[figure];
@@ -281,7 +281,7 @@ namespace gbrainy.Games.Memory
 
                void DrawGrid (CairoContextEx gr, double x, double y)
                {
-                       gr.Color = new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, alpha);
+                       gr.SetSourceColor (new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, 
DefaultDrawingColor.B, alpha));
                        for (int column = 0; column < columns; column++) {
                                for (int row = 0; row < rows; row++) {
                                        gr.Rectangle (x + column * rect_w, y + row * rect_h, rect_w, rect_h);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]