GNOME Bugzilla – Bug 735157
“Print current puzzle” prints a reversed (left-right) sudoku in RTL mode
Last modified: 2014-09-05 14:07:53 UTC
In a RTL context, the puzzle is reversed (the grid does that automatically, and now[1] the drawing so does correctly). But the “Print current puzzle” function uses his own drawing functions, and they doesn’t depend on the context, so in a RTL context it prints a reversed sudoku… Not sure if we should try to have generic functions to draw the grid or if we have to maintain these two drawing code. [1] https://bugzilla.gnome.org/show_bug.cgi?id=735020
It would indeed be best to merge the drawing code as much as possible, if you can do so without affecting the printer-friendly style. Does Print Multiple Puzzles work properly?
The problem is not that the printed sudoku grid is unplayable or so; so, no problem with the “multiple puzzles” function. The problem is that the “current puzzle” is not the one printed (they are similar to solve, but the numbers that were on the right column are printed on the left one).
Created attachment 284876 [details] [review] Print the good "current puzzle" in RTL. Here’s a patch that just corrects the bug.
Review of attachment 284876 [details] [review]: Thanks! ::: src/sudoku-printer.vala @@ +186,3 @@ var sudoku = sudoku_board.get_cells (); + var invert = Gtk.Widget.get_default_direction() == Gtk.TextDirection.RTL; Missing a space here before the ( @@ +190,3 @@ for (var x = 0; x < SUDOKU_SIZE; x++) { + var real_x = invert ? SUDOKU_SIZE - x -1 : x; And a space before the 1
Created attachment 285444 [details] [review] Print the good "current puzzle" in RTL.
Attachment 285444 [details] pushed as d3e6514 - Print the good "current puzzle" in RTL.