[gbrainy] Add x-axis scale



commit 50c83aeccf3ed0dff626a950b337c0671a08d90c
Author: Jordi Mas <jmas softcatala org>
Date:   Mon Nov 30 20:39:29 2009 +0100

    Add x-axis scale

 src/Core/Views/PlayerHistoryView.cs |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/Core/Views/PlayerHistoryView.cs b/src/Core/Views/PlayerHistoryView.cs
index a5e1d83..61046ec 100644
--- a/src/Core/Views/PlayerHistoryView.cs
+++ b/src/Core/Views/PlayerHistoryView.cs
@@ -219,13 +219,23 @@ namespace gbrainy.Core.Views
 			cr.LineTo (x + area_w, y + area_h);
 			cr.Stroke ();
 
+			cr.Save ();
 			cr.Color = new Cairo.Color (0.8, 0.8, 0.8);
 			cr.LineWidth = 0.001;
+
 			for (double line_y = y; line_y < area_h + y; line_y += area_h / 10) {
 				cr.MoveTo (x, line_y);
 				cr.LineTo (x + area_w, line_y);
 				cr.Stroke ();
 			}
+
+			cr.Restore ();
+
+			int pos = 100;
+			for (double line_y = y; line_y < area_h + y; line_y += area_h / 10) {
+				cr.DrawTextAlignedRight (x - 0.02, line_y - 0.02, String.Format ("{0}", pos));
+				pos -= 10;
+			}
 		}		
 
 		public void Draw (CairoContextEx cr, int width, int height, bool rtl)



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