[gbrainy] Move line for long text as needed



commit 13afa339b437221eb3552cb473e60087bfab46fd
Author: Jordi Mas <jmas softcatala org>
Date:   Tue Jun 14 22:40:25 2011 +0200

    Move line for long text as needed

 src/Clients/Classical/Widgets/GameDrawingArea.cs |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/Clients/Classical/Widgets/GameDrawingArea.cs b/src/Clients/Classical/Widgets/GameDrawingArea.cs
index 5ef140c..e09f48d 100644
--- a/src/Clients/Classical/Widgets/GameDrawingArea.cs
+++ b/src/Clients/Classical/Widgets/GameDrawingArea.cs
@@ -169,8 +169,12 @@ namespace gbrainy.Clients.Classical.Widgets
 			cr.DrawStringWithWrapping (text_margin, text_margin, Question, max_width);
 			cr.Stroke ();
 
+			double w, h, question_high_scaled;
+			cr.MeasureString (Question, max_width, true, out w, out h);
+
+			// We use a minimum hight, but if the text is longer (L10 versions) move the line as needed
+			question_high_scaled = Math.Max (question_high / (double) height, h);
 			cr.LineWidth = 0.002;
-			double question_high_scaled = question_high / (double) height;
 			cr.MoveTo (0.01, question_high_scaled + 0.01);
 			cr.LineTo (0.99, question_high_scaled + 0.01);
 			cr.Stroke ();



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