[gnome-games/sudoku-vala] sudoku: Compute scale based on height
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/sudoku-vala] sudoku: Compute scale based on height
- Date: Thu, 30 Jun 2011 07:32:18 +0000 (UTC)
commit 61faa0209db01d607772dfdc62f9b47f1c68167a
Author: LubomÃr SedlÃÅ <lubomir sedlar gmail com>
Date: Mon Jun 27 21:33:04 2011 +0200
sudoku: Compute scale based on height
Digit height tends to be larger than its width, therefore scaling them
to fit width made them overflow the cell.
gnome-sudoku/src/sudoku-view.vala | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/gnome-sudoku/src/sudoku-view.vala b/gnome-sudoku/src/sudoku-view.vala
index e14b5d7..ab19376 100644
--- a/gnome-sudoku/src/sudoku-view.vala
+++ b/gnome-sudoku/src/sudoku-view.vala
@@ -188,10 +188,9 @@ private class SudokuCellView : Gtk.DrawingArea
int width, height;
layout.get_size (out width, out height);
- width /= Pango.SCALE;
height /= Pango.SCALE;
- double scale = (double) get_allocated_width () / width;
+ double scale = (double) get_allocated_height () / height;
c.move_to ((get_allocated_width () - glyph_width * scale) / 2, (get_allocated_height () - glyph_height * scale) / 2);
c.scale (scale, scale);
Pango.cairo_update_layout (c, layout);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]