[gnome-games/sudoku-vala] sudoku: Convert layout dimensions from Pango units
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/sudoku-vala] sudoku: Convert layout dimensions from Pango units
- Date: Thu, 30 Jun 2011 07:32:13 +0000 (UTC)
commit f5c3573b2e1ef9279bcadca80656271410f4824e
Author: LubomÃr SedlÃÅ <lubomir sedlar gmail com>
Date: Mon Jun 27 21:29:32 2011 +0200
sudoku: Convert layout dimensions from Pango units
PangoLayout.get_size () returns dimensions in Pango units rather than
screen units. Not converting them caused scale to be so small the
displayed digit was invisible.
gnome-sudoku/src/sudoku-view.vala | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gnome-sudoku/src/sudoku-view.vala b/gnome-sudoku/src/sudoku-view.vala
index 89ed19d..e14b5d7 100644
--- a/gnome-sudoku/src/sudoku-view.vala
+++ b/gnome-sudoku/src/sudoku-view.vala
@@ -188,6 +188,8 @@ 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;
c.move_to ((get_allocated_width () - glyph_width * scale) / 2, (get_allocated_height () - glyph_height * scale) / 2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]