[gbrainy] Fixes bugzilla #653815



commit 70173ca2ca030a188ad304f65f07c2422e794390
Author: Jordi Mas <jmas softcatala org>
Date:   Sat Sep 10 15:26:42 2011 +0200

    Fixes bugzilla #653815

 src/Clients/Classical/Widgets/GameDrawingArea.cs |   19 +++++++++++--------
 src/Games/Logic/PuzzleGridDots.cs                |    1 -
 2 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/src/Clients/Classical/Widgets/GameDrawingArea.cs b/src/Clients/Classical/Widgets/GameDrawingArea.cs
index fda6f99..52a359b 100644
--- a/src/Clients/Classical/Widgets/GameDrawingArea.cs
+++ b/src/Clients/Classical/Widgets/GameDrawingArea.cs
@@ -185,11 +185,20 @@ namespace gbrainy.Clients.Classical.Widgets
 			if (UseSolutionArea == false || String.IsNullOrEmpty (Solution) == true)
 				return;
 
-			double box_height_scaled = solution_high / (double) height;
+			double width_str, height_str, x_text, icon_x, icon_w, icon_h, box_height_scaled;
 
 			cr.Save ();
 			cr.LineWidth = 0.001;
 
+			icon_w = icon_size * (cr.Matrix.Xx > cr.Matrix.Yy ? cr.Matrix.Yy / cr.Matrix.Xx : 1);
+			icon_h = icon_size * (cr.Matrix.Yy > cr.Matrix.Xx ? cr.Matrix.Xx / cr.Matrix.Yy : 1);
+
+			cr.MeasureString (Solution, max_width - icon_w, true, out width_str, out height_str);
+
+			// In case that the string to show is longer than the space reserved (long translations for example)
+			// allow the box to grow taking part of the lower part of the graphic
+			box_height_scaled = Math.Max (height_str, (double) solution_high / (double) height);
+
 			// Draw black box
 			cr.Color = new Color (0.1, 0.1, 0.1);
 
@@ -200,15 +209,9 @@ namespace gbrainy.Clients.Classical.Widgets
 			cr.Fill ();
 			cr.Stroke ();
 
-			double width_str, height_str, x_text, icon_x, icon_w, icon_h;
-
-			// Measure string to be able to centered vertically within the box
-			cr.MeasureString (Solution, max_width - icon_size, true, out width_str, out height_str);
+			// Draw text and icon
 			cr.Color = new Color (1, 1, 1);
 
-			icon_w = icon_size * (cr.Matrix.Xx > cr.Matrix.Yy ? cr.Matrix.Yy / cr.Matrix.Xx : 1);
-			icon_h = icon_size * (cr.Matrix.Yy > cr.Matrix.Xx ? cr.Matrix.Xx / cr.Matrix.Yy : 1);
-
 			if (Direction == Gtk.TextDirection.Rtl)
 			{
 				x_text = 0;
diff --git a/src/Games/Logic/PuzzleGridDots.cs b/src/Games/Logic/PuzzleGridDots.cs
index 1b99555..fad44f2 100644
--- a/src/Games/Logic/PuzzleGridDots.cs
+++ b/src/Games/Logic/PuzzleGridDots.cs
@@ -216,7 +216,6 @@ namespace gbrainy.Games.Logic
 			get {
 				switch (puzzle_index) {
 				case 0:
-					// Translators: Please, do not make the translated string longer than the original English one. It will not fit in screen.
 					return ServiceLocator.Instance.GetService <ITranslations> ().GetString ("From the top-left figure, the top-left circle moves down, the bottom-left circle moves up, the bottom-right moves diagonally up-left and the top-right moves diagonally down-left.");
 				case 2:
 					return ServiceLocator.Instance.GetService <ITranslations> ().GetString



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