Commit 927d11f7 authored by jean-pierre charras's avatar jean-pierre charras

Eeschema: fix Bug #1375581 (libraries setup empty after clicking "print" icon)

parent d4731da0
...@@ -1053,7 +1053,8 @@ void SCH_EDIT_FRAME::OnPrint( wxCommandEvent& event ) ...@@ -1053,7 +1053,8 @@ void SCH_EDIT_FRAME::OnPrint( wxCommandEvent& event )
if( fn.GetName() != NAMELESS_PROJECT ) if( fn.GetName() != NAMELESS_PROJECT )
{ {
// was: wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParametersList() ); // was: wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParametersList() );
Prj().ConfigSave( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParametersList() ); Prj().ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDITOR,
GetProjectFileParametersList() );
} }
} }
......
...@@ -27,53 +27,52 @@ ...@@ -27,53 +27,52 @@
* @brief unit conversion code * @brief unit conversion code
*/ */
// Unit conversion, must be conditionally adapter to the new // Unit conversion, between internal
// nanometer mode that will be soon included in pcbnew
%pythoncode %pythoncode
{ {
def ToMM(iu): def ToMM(iu):
if type(iu) in [int,float]: if type(iu) in [int,float]:
return float(iu) / float(IU_PER_MM) return float(iu) / float(IU_PER_MM)
elif type(iu) in [wxPoint,wxSize]: elif type(iu) in [wxPoint,wxSize]:
return tuple(map(ToMM,iu)) return tuple(map(ToMM,iu))
def FromMM(mm): def FromMM(mm):
if type(mm) in [int,float]: if type(mm) in [int,float]:
return int(float(mm) * float(IU_PER_MM)) return int(float(mm) * float(IU_PER_MM))
elif type(mm) in [wxPoint,wxSize]: elif type(mm) in [wxPoint,wxSize]:
return tuple(map(FromMM,mm)) return tuple(map(FromMM,mm))
def ToMils(iu): def ToMils(iu):
if type(iu) in [int,float]: if type(iu) in [int,float]:
return float(iu) / float(IU_PER_MILS) return float(iu) / float(IU_PER_MILS)
elif type(iu) in [wxPoint,wxSize]: elif type(iu) in [wxPoint,wxSize]:
return tuple(map(ToMils,iu)) return tuple(map(ToMils,iu))
def FromMils(mils): def FromMils(mils):
if type(mils) in [int,float]: if type(mils) in [int,float]:
return int(float(mils)*float(IU_PER_MILS)) return int(float(mils)*float(IU_PER_MILS))
elif type(mils) in [wxPoint,wxSize]: elif type(mils) in [wxPoint,wxSize]:
return tuple(map(FromMils,mils)) return tuple(map(FromMils,mils))
def wxSizeMM(mmx,mmy): return wxSize(FromMM(mmx),FromMM(mmy)) def wxSizeMM(mmx,mmy): return wxSize(FromMM(mmx),FromMM(mmy))
def wxSizeMils(mmx,mmy): return wxSize(FromMils(mmx),FromMils(mmy)) def wxSizeMils(mmx,mmy): return wxSize(FromMils(mmx),FromMils(mmy))
def wxPointMM(mmx,mmy): return wxPoint(FromMM(mmx),FromMM(mmy)) def wxPointMM(mmx,mmy): return wxPoint(FromMM(mmx),FromMM(mmy))
def wxPointMils(mmx,mmy): return wxPoint(FromMils(mmx),FromMils(mmy)) def wxPointMils(mmx,mmy): return wxPoint(FromMils(mmx),FromMils(mmy))
def wxRectMM(x,y,wx,wy): def wxRectMM(x,y,wx,wy):
x = int(FromMM(x)) x = int(FromMM(x))
y = int(FromMM(y)) y = int(FromMM(y))
wx = int(FromMM(wx)) wx = int(FromMM(wx))
wy = int (FromMM(wy)) wy = int (FromMM(wy))
return wxRect(x,y,wx,wy) return wxRect(x,y,wx,wy)
def wxRectMils(x,y,wx,wy): def wxRectMils(x,y,wx,wy):
x = int(FromMils(x)) x = int(FromMils(x))
y = int(FromMils(y)) y = int(FromMils(y))
wx = int(FromMils(wx)) wx = int(FromMils(wx))
wy = int (FromMils(wy)) wy = int (FromMils(wy))
return wxRect(x,y,wx,wy) return wxRect(x,y,wx,wy)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment