[gnome-games] Use sharp lines for Sudoku preview
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] Use sharp lines for Sudoku preview
- Date: Wed, 21 Apr 2010 02:05:37 +0000 (UTC)
commit 82195edbe497efec16c914767bb2807698d9864d
Author: Robert Ancell <robert ancell gmail com>
Date: Wed Apr 21 12:05:29 2010 +1000
Use sharp lines for Sudoku preview
gnome-sudoku/src/lib/sudoku_thumber.py | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/gnome-sudoku/src/lib/sudoku_thumber.py b/gnome-sudoku/src/lib/sudoku_thumber.py
index 1a846bf..b8cb242 100644
--- a/gnome-sudoku/src/lib/sudoku_thumber.py
+++ b/gnome-sudoku/src/lib/sudoku_thumber.py
@@ -9,9 +9,10 @@ BACKGROUND_COLOR = (1., 1., 1.)
def draw_sudoku (cr, sudoku, played, size, offset_x = 0, offset_y = 0, border_color = (1.0, 1.0, 1.0), line_color = (0.0, 0.0, 0.0), for_printing = False):
- THIN = size / 100.
if for_printing:
- THIN /= 3
+ THIN = size / 300.
+ else:
+ THIN = 1
THICK = THIN * 2.
BORDER = THICK
@@ -24,12 +25,13 @@ def draw_sudoku (cr, sudoku, played, size, offset_x = 0, offset_y = 0, border_co
)
SQUARE_SIZE = WHITE_SPACE / SUDOKU_SIZE
- FONT_SIZE = SQUARE_SIZE
- FONT_WEIGHT = cairo.FONT_WEIGHT_BOLD
if for_printing:
- FONT_SIZE /= 2
+ FONT_SIZE = SQUARE_SIZE / 2
FONT_WEIGHT = cairo.FONT_WEIGHT_NORMAL
+ else:
+ FONT_SIZE = SQUARE_SIZE
+ FONT_WEIGHT = cairo.FONT_WEIGHT_BOLD
outer = {}
outer["left"] = offset_x
@@ -126,7 +128,7 @@ def draw_sudoku (cr, sudoku, played, size, offset_x = 0, offset_y = 0, border_co
cr.show_text(letter)
def make_pixbuf (sudoku, played, border_color, line_color = (0.4, 0.4, 0.4)):
- size = 120
+ size = 126
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, size, size)
cr = cairo.Context(surface)
draw_sudoku(cr, sudoku, played, size, 0, 0, border_color, line_color)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]