[chronojump/michrolab] drawCircle method on gui/cairo/xy.cs



commit 83b8402add3bdaa166929e36db007d1d11a50237
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Jul 26 13:55:52 2022 +0200

    drawCircle method on gui/cairo/xy.cs

 src/gui/cairo/raceAnalyzer.cs | 6 +-----
 src/gui/cairo/xy.cs           | 8 ++++++++
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/cairo/raceAnalyzer.cs b/src/gui/cairo/raceAnalyzer.cs
index 53a88cec5..63c8fbe88 100644
--- a/src/gui/cairo/raceAnalyzer.cs
+++ b/src/gui/cairo/raceAnalyzer.cs
@@ -314,11 +314,7 @@ public class CairoGraphRaceAnalyzer : CairoXY
                                        }
                                        graphX = calculatePaintX (graphX);
                                        graphY = calculatePaintY (graphY);
-
-                                       g.MoveTo(graphX +8, graphY);
-                                       g.Arc(graphX, graphY, 8.0, 0.0, 2.0 * Math.PI); //full circle
-                                       g.SetSourceColor(red);
-                                       g.Stroke();
+                                       drawCircle (graphX, graphY, 8, red);
                                }
                        }
 
diff --git a/src/gui/cairo/xy.cs b/src/gui/cairo/xy.cs
index 243d4fbc6..24f232565 100644
--- a/src/gui/cairo/xy.cs
+++ b/src/gui/cairo/xy.cs
@@ -756,4 +756,12 @@ public abstract class CairoXY : CairoGeneric
        }
        */
 
+       protected void drawCircle (double x, double y, double radio, Cairo.Color color)
+       {
+               g.MoveTo(x +radio, y);
+               g.Arc(x, y, radio, 0.0, 2.0 * Math.PI); //full circle
+               g.SetSourceColor(color);
+               g.Stroke();
+       }
+
 }


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