Graphics rendered backwards on RTL Windows system

Bug #1559545 reported by Chris Pavlina on 2016-03-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
High
Unassigned

Bug Description

See attached screenshot, if the Windows display language is set to an RTL language such as Hebrew or Arabic, graphics (at least eeschema, probably pcbnew legacy and gerbview as well) render mirrored.

Steps to reproduce, on at least Windows 10:
1) Install Hebrew language pack.
2) Reboot. Some sources indicate this is necessary, I did to be safe.
3) Switch display language to Hebrew.
4) Start kicad.

Hint for those who don't speak the language: don't log out after switching the language - it says you have to, but that's only to switch over the main Windows GUI. If you don't log out, you'll still be able to read the GUI to switch back to your native language ;)

Application: eeschema
Version: (2016-01-22 BZR 6629, Git 827c455)-product debug build
wxWidgets: Version 3.0.2 (debug,wchar_t,compiler with C++ ABI 1009,GCC 5.3.0,wx containers,compatible with 2.8)
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Boost version: 1.57.0
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=OFF
         KICAD_SCRIPTING_MODULES=OFF
         KICAD_SCRIPTING_WXPYTHON=OFF
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=ON

I'm going to look into this a bit, though I'm not assigning myself for now - if it's a ton of work I don't have time right now, hopefully someone else can look into it. I hope it's simple.

Set confirmed as I am "confirming" this after seeing someone else's claim of this bug.

Related branches

Chris Pavlina (pavlina-chris) wrote :
Chris Pavlina (pavlina-chris) wrote :

Even worse in Linux, LC_ALL=he_IL gives me a totally black canvas.

Chris Pavlina (pavlina-chris) wrote :

This fixes it for the main panel, unfortunately it is necessary to apply this to every instance of wxDC graphics throughout kicad (for instance in the component selector). Any wx wizards know a better way?

diff --git a/common/draw_panel.cpp b/common/draw_panel.cpp
index 6d20489..55fb82b 100644
--- a/common/draw_panel.cpp
+++ b/common/draw_panel.cpp
@@ -103,6 +103,8 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
     m_scrollIncrementX = std::min( size.x / 8, 10 );
     m_scrollIncrementY = std::min( size.y / 8, 10 );

+ SetLayoutDirection( wxLayout_LeftToRight );
+
     SetBackgroundColour( MakeColour( parent->GetDrawBgColor() ) );

 #if KICAD_USE_BUFFERED_DC || KICAD_USE_BUFFERED_PAINTDC

Chris Pavlina (pavlina-chris) wrote :

I *think* this is all of them. I'd really appreciate it if someone could look around for more, or even come up with a better solution :)

Changed in kicad:
status: Confirmed → In Progress
Chris Pavlina (pavlina-chris) wrote :

Since nobody has complained or helped test, I'm committing this. Feel free to reopen if something breaks.

Changed in kicad:
status: In Progress → Fix Committed
Anas (anastien) wrote :

I'm an arabic user and I have been using KiCad for a while on linux, there is no such a problem after switching to arabic.

Chris Pavlina (pavlina-chris) wrote :

That's curious. Any chance you can share the output of the 'locale' command? A temporary switch using LC_ALL=he_IL.UTF-8 (oops, left out the UTF-8 in the comment above) definitely causes it.

(If not don't worry about it, the fix for this bug won't make it worse on your system or anything :)

Anas (anastien) wrote :

this is the output 'locale' :
LANG=en_US.UTF-8
LANGUAGE=en_US:ar
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=ar_EG.UTF-8
LC_TIME=ar_EG.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=ar_EG.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=ar_EG.UTF-8
LC_NAME=ar_EG.UTF-8
LC_ADDRESS=ar_EG.UTF-8
LC_TELEPHONE=ar_EG.UTF-8
LC_MEASUREMENT=ar_EG.UTF-8
LC_IDENTIFICATION=ar_EG.UTF-8
LC_ALL=
  the fix doesn't do any harm, I also asked a friend who uses the software and the only problem he has that the hot keys doesn't work.

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.