After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735157 - “Print current puzzle” prints a reversed (left-right) sudoku in RTL mode
“Print current puzzle” prints a reversed (left-right) sudoku in RTL mode
Status: RESOLVED FIXED
Product: gnome-sudoku
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-sudoku-maint
gnome-sudoku-maint
Depends on:
Blocks:
 
 
Reported: 2014-08-21 12:47 UTC by Arnaud B.
Modified: 2014-09-05 14:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Print the good "current puzzle" in RTL. (1.51 KB, patch)
2014-08-30 00:07 UTC, Arnaud B.
reviewed Details | Review
Print the good "current puzzle" in RTL. (1.46 KB, patch)
2014-09-05 00:20 UTC, Arnaud B.
committed Details | Review

Description Arnaud B. 2014-08-21 12:47:13 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
Comment 1 Michael Catanzaro 2014-08-21 14:03:53 UTC
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?
Comment 2 Arnaud B. 2014-08-21 14:27:39 UTC
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).
Comment 3 Arnaud B. 2014-08-30 00:07:45 UTC
Created attachment 284876 [details] [review]
Print the good "current puzzle" in RTL.

Here’s a patch that just corrects the bug.
Comment 4 Michael Catanzaro 2014-09-04 21:56:55 UTC
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
Comment 5 Arnaud B. 2014-09-05 00:20:56 UTC
Created attachment 285444 [details] [review]
Print the good "current puzzle" in RTL.
Comment 6 Michael Catanzaro 2014-09-05 14:07:50 UTC
Attachment 285444 [details] pushed as d3e6514 - Print the good "current puzzle" in RTL.