Loading CHANGELOG.txt +9 −0 Original line number Original line Diff line number Diff line Loading @@ -5,6 +5,15 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with email address. email address. 2009-Jan-29 UPDATE Wayne Stambaugh <stambaughw@verizon.net> ================================================================================ ++All * Replace zoom implementation with a more flexible ( and hopefully useful ) design. * Removed gr_basic.h from fctsys.h so that the entire project doesn't get rebuilt unnecessarily. 2009-Jan-29 UPDATE Dick Hollenbeck <dick@softplc.com> 2009-Jan-29 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ ================================================================================ ++eeschema ++eeschema Loading common/base_screen.cpp +111 −71 Original line number Original line Diff line number Diff line Loading @@ -25,14 +25,14 @@ WX_DEFINE_OBJARRAY( GridArray ); BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_BaseStruct( aType ) BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_BaseStruct( aType ) { { EEDrawList = NULL; /* Schematic items list */ EEDrawList = NULL; /* Schematic items list */ m_ZoomList = NULL; m_UndoList = NULL; m_UndoList = NULL; m_RedoList = NULL; m_RedoList = NULL; m_UndoRedoCountMax = 1; m_UndoRedoCountMax = 1; m_FirstRedraw = TRUE; m_FirstRedraw = TRUE; m_ScreenNumber = 1; m_ScreenNumber = 1; m_NumberOfScreen = 1; /* Hierarchy: Root: ScreenNumber = 1 */ m_NumberOfScreen = 1; /* Hierarchy: Root: ScreenNumber = 1 */ m_Zoom = 32; m_ZoomScalar = 10; m_Zoom = 32 * m_ZoomScalar; m_Grid = wxSize( 50, 50 ); /* Default grid size */ m_Grid = wxSize( 50, 50 ); /* Default grid size */ m_UserGridIsON = FALSE; m_UserGridIsON = FALSE; m_Diviseur_Grille = 1; m_Diviseur_Grille = 1; Loading @@ -47,9 +47,6 @@ BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_BaseStruct( aType ) BASE_SCREEN::~BASE_SCREEN() BASE_SCREEN::~BASE_SCREEN() /******************************/ /******************************/ { { if( m_ZoomList ) free( m_ZoomList ); ClearUndoRedoList(); ClearUndoRedoList(); } } Loading Loading @@ -101,131 +98,174 @@ wxSize BASE_SCREEN::ReturnPageSize( void ) { { int internal_units = GetInternalUnits(); int internal_units = GetInternalUnits(); return wxSize( m_CurrentSheetDesc->m_Size.x * (internal_units / 1000), return wxSize( ( m_CurrentSheetDesc->m_Size.x * internal_units ) / 1000, m_CurrentSheetDesc->m_Size.y * (internal_units / 1000) ); ( m_CurrentSheetDesc->m_Size.y * internal_units ) / 1000 ); } } /******************************************************************/ /******************************************************************/ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos ) wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos ) /******************************************************************/ /******************************************************************/ { { wxPoint curpos; wxPoint curpos = ScreenPos; Unscale( curpos ); // D(printf("curpos=%d,%d GetZoom=%d, mDrawOrg=%d,%d\n", curpos.x, curpos.y, GetZoom(), m_DrawOrg.x, m_DrawOrg.y );) // D(printf("curpos=%d,%d GetZoom=%d, mDrawOrg=%d,%d\n", curpos.x, curpos.y, GetZoom(), m_DrawOrg.x, m_DrawOrg.y );) curpos.x = ScreenPos.x * GetZoom(); // curpos.x = Unscale( ScreenPos.x ); curpos.y = ScreenPos.y * GetZoom(); // curpos.y = Unscale( ScreenPos.y ); curpos.x += m_DrawOrg.x; curpos += m_DrawOrg; curpos.y += m_DrawOrg.y; return curpos; return curpos; } } /** * Calculate coordinate value for zooming. * * Call this method when drawing on the device context. It scales the * coordinate using the current zoom settings. Zooming in Kicad occurs * by actually scaling the entire drawing using the zoom setting. * * FIXME: We should probably use wxCoord instead of int here but that would * require using wxCoord in all of the other code that makes device * context calls as well. */ int BASE_SCREEN::Scale( int coord ) { #ifdef WX_ZOOM return coord; #else if( !m_Zoom ) return 0; /**************************************************/ if( !m_ZoomScalar || !m_Zoom ) void BASE_SCREEN::SetZoomList( const int* zoomlist ) return 0; /**************************************************/ /* init liste des zoom (NULL terminated) return wxRound( (double) ( coord * m_ZoomScalar ) / (double) m_Zoom ); */ #endif } void BASE_SCREEN::Scale( wxPoint& pt ) { { int nbitems; pt.x = Scale( pt.x ); const int* zoom; pt.y = Scale( pt.y ); } // get list length for( nbitems = 1, zoom = zoomlist; ; zoom++, nbitems++ ) void BASE_SCREEN::Scale( wxSize& sz ) { { if( *zoom == 0 ) sz.SetHeight( Scale( sz.GetHeight() ) ); break; sz.SetWidth( Scale( sz.GetWidth() ) ); } } // resize our list if( m_ZoomList ) free( m_ZoomList ); m_ZoomList = (int*) MyZMalloc( nbitems * sizeof(int) ); /** * Calculate the physical (unzoomed) location of a coordinate. * * Call this method when you want to find the unzoomed (physical) location * of a coordinate on the drawing. */ int BASE_SCREEN::Unscale( int coord ) { #ifdef WX_ZOOM return coord; #else if( !m_Zoom || !m_ZoomScalar ) return 0; int ii; return wxRound( (double) ( coord * m_Zoom ) / (double) m_ZoomScalar ); for( ii = 0, zoom = zoomlist; ii < nbitems; zoom++, ii++ ) #endif } void BASE_SCREEN::Unscale( wxPoint& pt ) { { m_ZoomList[ii] = *zoom; pt.x = Unscale( pt.x ); pt.y = Unscale( pt.y ); } } void BASE_SCREEN::Unscale( wxSize& sz ) { sz.SetHeight( Unscale( sz.GetHeight() ) ); sz.SetWidth( Unscale( sz.GetWidth() ) ); } void BASE_SCREEN::SetZoomList( const wxArrayInt& zoomlist ) { if( !m_ZoomList.IsEmpty() ) m_ZoomList.Empty(); m_ZoomList = zoomlist; } } /***********************************/ void BASE_SCREEN::SetFirstZoom() void BASE_SCREEN::SetFirstZoom() /***********************************/ { { m_Zoom = 1; if( m_ZoomList.IsEmpty() ) m_Zoom = m_ZoomScalar; else m_Zoom = m_ZoomList[0]; } } /******************************/ int BASE_SCREEN::GetZoom() const int BASE_SCREEN::GetZoom() const /******************************/ { { return m_Zoom; return m_Zoom; } } /***********************************/ void BASE_SCREEN::SetZoom( int coeff ) void BASE_SCREEN::SetZoom( int coeff ) /***********************************/ { { m_Zoom = coeff; m_Zoom = coeff; if( m_Zoom < 1 ) if( m_Zoom < 1 ) m_Zoom = 1; m_Zoom = 1; } } /********************************/ void BASE_SCREEN::SetNextZoom() void BASE_SCREEN::SetNextZoom() /********************************/ /* Selectionne le prochain coeff de zoom */ { { m_Zoom *= 2; size_t i; if( m_ZoomList == NULL ) if( m_ZoomList.IsEmpty() || m_Zoom >= m_ZoomList.Last() ) return; return; int ii, zoom_max = 512; for( i = 0; i < m_ZoomList.GetCount(); i++ ) for( ii = 0; m_ZoomList[ii] != 0; ii++ ) { zoom_max = m_ZoomList[ii]; if( m_Zoom < m_ZoomList[i] ) { if( m_Zoom > zoom_max ) m_Zoom = m_ZoomList[i]; m_Zoom = zoom_max; break; } } } } /*************************************/ void BASE_SCREEN::SetPreviousZoom() void BASE_SCREEN::SetPreviousZoom() /*************************************/ { size_t i; /* Selectionne le precedent coeff de zoom if( m_ZoomList.IsEmpty() || m_Zoom <= m_ZoomList[0] ) */ return; for( i = m_ZoomList.GetCount(); i != 0; i-- ) { { m_Zoom /= 2; if( m_Zoom > m_ZoomList[i - 1] ) if( m_Zoom < 1 ) { m_Zoom = 1; m_Zoom = m_ZoomList[i - 1]; break; } } } } /**********************************/ void BASE_SCREEN::SetLastZoom() void BASE_SCREEN::SetLastZoom() /**********************************/ /* ajuste le coeff de zoom au max */ { { if( m_ZoomList == NULL ) if( m_ZoomList.IsEmpty() ) return; return; int ii; for( ii = 0; m_ZoomList[ii] != 0; ii++ ) m_Zoom = m_ZoomList.Last(); m_Zoom = m_ZoomList[ii]; } } Loading common/base_struct.cpp +2 −3 Original line number Original line Diff line number Diff line Loading @@ -7,6 +7,7 @@ /* Fichier base_struct.cpp */ /* Fichier base_struct.cpp */ #include "fctsys.h" #include "fctsys.h" #include "gr_basic.h" #include "trigo.h" #include "trigo.h" #include "common.h" #include "common.h" #include "wxstruct.h" #include "wxstruct.h" Loading Loading @@ -272,10 +273,8 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, * @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ). * @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ). */ */ { { int zoom; int width; int width; zoom = aPanel->GetZoom(); width = m_Width; width = m_Width; if( aDisplayMode == FILAIRE ) if( aDisplayMode == FILAIRE ) width = 0; width = 0; Loading @@ -286,7 +285,7 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, /* Draw text anchor, if allowed */ /* Draw text anchor, if allowed */ if( aAnchor_color != UNSPECIFIED_COLOR ) if( aAnchor_color != UNSPECIFIED_COLOR ) { { int anchor_size = 2 * zoom; int anchor_size = aPanel->GetScreen()->Unscale( 2 ); aAnchor_color = (EDA_Colors) (aAnchor_color & MASKCOLOR); aAnchor_color = (EDA_Colors) (aAnchor_color & MASKCOLOR); int cX = m_Pos.x + aOffset.x; int cX = m_Pos.x + aOffset.x; Loading common/basicframe.cpp +17 −7 Original line number Original line Diff line number Diff line Loading @@ -209,6 +209,7 @@ wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId, void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) /**************************************************************/ /**************************************************************/ { { wxString msg; #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML if( wxGetApp().m_HtmlCtrl == NULL ) if( wxGetApp().m_HtmlCtrl == NULL ) { { Loading @@ -223,19 +224,28 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) } } else else { { wxString msg; msg.Printf( _( "Help file %s not found" ), wxGetApp().m_HelpFileName.GetData() ); msg.Printf( _( "Help file %s not found" ), wxGetApp().m_HelpFileName.GetData() ); DisplayError( this, msg ); DisplayError( this, msg ); } } #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName; // wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName; if ( wxFileExists(fullfilename) ) // if ( wxFileExists(fullfilename) ) GetAssociatedDocument( this, wxEmptyString, fullfilename ); // GetAssociatedDocument( this, wxEmptyString, fullfilename ); else // Try to find file in English format: // else // Try to find file in English format: // { // fullfilename = FindKicadHelpPath() + wxT("../en/") + wxGetApp().m_HelpFileName;; // GetAssociatedDocument( this, wxEmptyString, fullfilename ); // } wxString helpFile = wxGetApp().GetHelpFile(); if( !helpFile ) { { fullfilename = FindKicadHelpPath() + wxT("../en/") + wxGetApp().m_HelpFileName;; msg.Printf( _( "Help file %s could not be found." ), GetAssociatedDocument( this, wxEmptyString, fullfilename ); wxGetApp().m_HelpFileName.c_str() ); DisplayError( this, msg ); } } else GetAssociatedDocument( this, wxEmptyString, helpFile ); #else #else #error Help files format not defined #error Help files format not defined Loading common/block_commande.cpp +5 −5 Original line number Original line Diff line number Diff line Loading @@ -110,8 +110,8 @@ void DrawBlockStruct::SetMessageBlock( WinEDA_DrawFrame* frame ) void DrawBlockStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC ) void DrawBlockStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC ) /**************************************************************/ /**************************************************************/ { { int w = GetWidth() / panel->GetZoom(); int w = panel->GetScreen()->Scale( GetWidth() ); int h = GetHeight() / panel->GetZoom(); int h = panel->GetScreen()->Scale( GetHeight() ); if( w == 0 || h == 0 ) if( w == 0 || h == 0 ) GRLine( &panel->m_ClipBox, DC, GetX(), GetY(), GRLine( &panel->m_ClipBox, DC, GetX(), GetY(), Loading Loading
CHANGELOG.txt +9 −0 Original line number Original line Diff line number Diff line Loading @@ -5,6 +5,15 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with email address. email address. 2009-Jan-29 UPDATE Wayne Stambaugh <stambaughw@verizon.net> ================================================================================ ++All * Replace zoom implementation with a more flexible ( and hopefully useful ) design. * Removed gr_basic.h from fctsys.h so that the entire project doesn't get rebuilt unnecessarily. 2009-Jan-29 UPDATE Dick Hollenbeck <dick@softplc.com> 2009-Jan-29 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ ================================================================================ ++eeschema ++eeschema Loading
common/base_screen.cpp +111 −71 Original line number Original line Diff line number Diff line Loading @@ -25,14 +25,14 @@ WX_DEFINE_OBJARRAY( GridArray ); BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_BaseStruct( aType ) BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_BaseStruct( aType ) { { EEDrawList = NULL; /* Schematic items list */ EEDrawList = NULL; /* Schematic items list */ m_ZoomList = NULL; m_UndoList = NULL; m_UndoList = NULL; m_RedoList = NULL; m_RedoList = NULL; m_UndoRedoCountMax = 1; m_UndoRedoCountMax = 1; m_FirstRedraw = TRUE; m_FirstRedraw = TRUE; m_ScreenNumber = 1; m_ScreenNumber = 1; m_NumberOfScreen = 1; /* Hierarchy: Root: ScreenNumber = 1 */ m_NumberOfScreen = 1; /* Hierarchy: Root: ScreenNumber = 1 */ m_Zoom = 32; m_ZoomScalar = 10; m_Zoom = 32 * m_ZoomScalar; m_Grid = wxSize( 50, 50 ); /* Default grid size */ m_Grid = wxSize( 50, 50 ); /* Default grid size */ m_UserGridIsON = FALSE; m_UserGridIsON = FALSE; m_Diviseur_Grille = 1; m_Diviseur_Grille = 1; Loading @@ -47,9 +47,6 @@ BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_BaseStruct( aType ) BASE_SCREEN::~BASE_SCREEN() BASE_SCREEN::~BASE_SCREEN() /******************************/ /******************************/ { { if( m_ZoomList ) free( m_ZoomList ); ClearUndoRedoList(); ClearUndoRedoList(); } } Loading Loading @@ -101,131 +98,174 @@ wxSize BASE_SCREEN::ReturnPageSize( void ) { { int internal_units = GetInternalUnits(); int internal_units = GetInternalUnits(); return wxSize( m_CurrentSheetDesc->m_Size.x * (internal_units / 1000), return wxSize( ( m_CurrentSheetDesc->m_Size.x * internal_units ) / 1000, m_CurrentSheetDesc->m_Size.y * (internal_units / 1000) ); ( m_CurrentSheetDesc->m_Size.y * internal_units ) / 1000 ); } } /******************************************************************/ /******************************************************************/ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos ) wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos ) /******************************************************************/ /******************************************************************/ { { wxPoint curpos; wxPoint curpos = ScreenPos; Unscale( curpos ); // D(printf("curpos=%d,%d GetZoom=%d, mDrawOrg=%d,%d\n", curpos.x, curpos.y, GetZoom(), m_DrawOrg.x, m_DrawOrg.y );) // D(printf("curpos=%d,%d GetZoom=%d, mDrawOrg=%d,%d\n", curpos.x, curpos.y, GetZoom(), m_DrawOrg.x, m_DrawOrg.y );) curpos.x = ScreenPos.x * GetZoom(); // curpos.x = Unscale( ScreenPos.x ); curpos.y = ScreenPos.y * GetZoom(); // curpos.y = Unscale( ScreenPos.y ); curpos.x += m_DrawOrg.x; curpos += m_DrawOrg; curpos.y += m_DrawOrg.y; return curpos; return curpos; } } /** * Calculate coordinate value for zooming. * * Call this method when drawing on the device context. It scales the * coordinate using the current zoom settings. Zooming in Kicad occurs * by actually scaling the entire drawing using the zoom setting. * * FIXME: We should probably use wxCoord instead of int here but that would * require using wxCoord in all of the other code that makes device * context calls as well. */ int BASE_SCREEN::Scale( int coord ) { #ifdef WX_ZOOM return coord; #else if( !m_Zoom ) return 0; /**************************************************/ if( !m_ZoomScalar || !m_Zoom ) void BASE_SCREEN::SetZoomList( const int* zoomlist ) return 0; /**************************************************/ /* init liste des zoom (NULL terminated) return wxRound( (double) ( coord * m_ZoomScalar ) / (double) m_Zoom ); */ #endif } void BASE_SCREEN::Scale( wxPoint& pt ) { { int nbitems; pt.x = Scale( pt.x ); const int* zoom; pt.y = Scale( pt.y ); } // get list length for( nbitems = 1, zoom = zoomlist; ; zoom++, nbitems++ ) void BASE_SCREEN::Scale( wxSize& sz ) { { if( *zoom == 0 ) sz.SetHeight( Scale( sz.GetHeight() ) ); break; sz.SetWidth( Scale( sz.GetWidth() ) ); } } // resize our list if( m_ZoomList ) free( m_ZoomList ); m_ZoomList = (int*) MyZMalloc( nbitems * sizeof(int) ); /** * Calculate the physical (unzoomed) location of a coordinate. * * Call this method when you want to find the unzoomed (physical) location * of a coordinate on the drawing. */ int BASE_SCREEN::Unscale( int coord ) { #ifdef WX_ZOOM return coord; #else if( !m_Zoom || !m_ZoomScalar ) return 0; int ii; return wxRound( (double) ( coord * m_Zoom ) / (double) m_ZoomScalar ); for( ii = 0, zoom = zoomlist; ii < nbitems; zoom++, ii++ ) #endif } void BASE_SCREEN::Unscale( wxPoint& pt ) { { m_ZoomList[ii] = *zoom; pt.x = Unscale( pt.x ); pt.y = Unscale( pt.y ); } } void BASE_SCREEN::Unscale( wxSize& sz ) { sz.SetHeight( Unscale( sz.GetHeight() ) ); sz.SetWidth( Unscale( sz.GetWidth() ) ); } void BASE_SCREEN::SetZoomList( const wxArrayInt& zoomlist ) { if( !m_ZoomList.IsEmpty() ) m_ZoomList.Empty(); m_ZoomList = zoomlist; } } /***********************************/ void BASE_SCREEN::SetFirstZoom() void BASE_SCREEN::SetFirstZoom() /***********************************/ { { m_Zoom = 1; if( m_ZoomList.IsEmpty() ) m_Zoom = m_ZoomScalar; else m_Zoom = m_ZoomList[0]; } } /******************************/ int BASE_SCREEN::GetZoom() const int BASE_SCREEN::GetZoom() const /******************************/ { { return m_Zoom; return m_Zoom; } } /***********************************/ void BASE_SCREEN::SetZoom( int coeff ) void BASE_SCREEN::SetZoom( int coeff ) /***********************************/ { { m_Zoom = coeff; m_Zoom = coeff; if( m_Zoom < 1 ) if( m_Zoom < 1 ) m_Zoom = 1; m_Zoom = 1; } } /********************************/ void BASE_SCREEN::SetNextZoom() void BASE_SCREEN::SetNextZoom() /********************************/ /* Selectionne le prochain coeff de zoom */ { { m_Zoom *= 2; size_t i; if( m_ZoomList == NULL ) if( m_ZoomList.IsEmpty() || m_Zoom >= m_ZoomList.Last() ) return; return; int ii, zoom_max = 512; for( i = 0; i < m_ZoomList.GetCount(); i++ ) for( ii = 0; m_ZoomList[ii] != 0; ii++ ) { zoom_max = m_ZoomList[ii]; if( m_Zoom < m_ZoomList[i] ) { if( m_Zoom > zoom_max ) m_Zoom = m_ZoomList[i]; m_Zoom = zoom_max; break; } } } } /*************************************/ void BASE_SCREEN::SetPreviousZoom() void BASE_SCREEN::SetPreviousZoom() /*************************************/ { size_t i; /* Selectionne le precedent coeff de zoom if( m_ZoomList.IsEmpty() || m_Zoom <= m_ZoomList[0] ) */ return; for( i = m_ZoomList.GetCount(); i != 0; i-- ) { { m_Zoom /= 2; if( m_Zoom > m_ZoomList[i - 1] ) if( m_Zoom < 1 ) { m_Zoom = 1; m_Zoom = m_ZoomList[i - 1]; break; } } } } /**********************************/ void BASE_SCREEN::SetLastZoom() void BASE_SCREEN::SetLastZoom() /**********************************/ /* ajuste le coeff de zoom au max */ { { if( m_ZoomList == NULL ) if( m_ZoomList.IsEmpty() ) return; return; int ii; for( ii = 0; m_ZoomList[ii] != 0; ii++ ) m_Zoom = m_ZoomList.Last(); m_Zoom = m_ZoomList[ii]; } } Loading
common/base_struct.cpp +2 −3 Original line number Original line Diff line number Diff line Loading @@ -7,6 +7,7 @@ /* Fichier base_struct.cpp */ /* Fichier base_struct.cpp */ #include "fctsys.h" #include "fctsys.h" #include "gr_basic.h" #include "trigo.h" #include "trigo.h" #include "common.h" #include "common.h" #include "wxstruct.h" #include "wxstruct.h" Loading Loading @@ -272,10 +273,8 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, * @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ). * @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ). */ */ { { int zoom; int width; int width; zoom = aPanel->GetZoom(); width = m_Width; width = m_Width; if( aDisplayMode == FILAIRE ) if( aDisplayMode == FILAIRE ) width = 0; width = 0; Loading @@ -286,7 +285,7 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, /* Draw text anchor, if allowed */ /* Draw text anchor, if allowed */ if( aAnchor_color != UNSPECIFIED_COLOR ) if( aAnchor_color != UNSPECIFIED_COLOR ) { { int anchor_size = 2 * zoom; int anchor_size = aPanel->GetScreen()->Unscale( 2 ); aAnchor_color = (EDA_Colors) (aAnchor_color & MASKCOLOR); aAnchor_color = (EDA_Colors) (aAnchor_color & MASKCOLOR); int cX = m_Pos.x + aOffset.x; int cX = m_Pos.x + aOffset.x; Loading
common/basicframe.cpp +17 −7 Original line number Original line Diff line number Diff line Loading @@ -209,6 +209,7 @@ wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId, void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) /**************************************************************/ /**************************************************************/ { { wxString msg; #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML if( wxGetApp().m_HtmlCtrl == NULL ) if( wxGetApp().m_HtmlCtrl == NULL ) { { Loading @@ -223,19 +224,28 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) } } else else { { wxString msg; msg.Printf( _( "Help file %s not found" ), wxGetApp().m_HelpFileName.GetData() ); msg.Printf( _( "Help file %s not found" ), wxGetApp().m_HelpFileName.GetData() ); DisplayError( this, msg ); DisplayError( this, msg ); } } #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName; // wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName; if ( wxFileExists(fullfilename) ) // if ( wxFileExists(fullfilename) ) GetAssociatedDocument( this, wxEmptyString, fullfilename ); // GetAssociatedDocument( this, wxEmptyString, fullfilename ); else // Try to find file in English format: // else // Try to find file in English format: // { // fullfilename = FindKicadHelpPath() + wxT("../en/") + wxGetApp().m_HelpFileName;; // GetAssociatedDocument( this, wxEmptyString, fullfilename ); // } wxString helpFile = wxGetApp().GetHelpFile(); if( !helpFile ) { { fullfilename = FindKicadHelpPath() + wxT("../en/") + wxGetApp().m_HelpFileName;; msg.Printf( _( "Help file %s could not be found." ), GetAssociatedDocument( this, wxEmptyString, fullfilename ); wxGetApp().m_HelpFileName.c_str() ); DisplayError( this, msg ); } } else GetAssociatedDocument( this, wxEmptyString, helpFile ); #else #else #error Help files format not defined #error Help files format not defined Loading
common/block_commande.cpp +5 −5 Original line number Original line Diff line number Diff line Loading @@ -110,8 +110,8 @@ void DrawBlockStruct::SetMessageBlock( WinEDA_DrawFrame* frame ) void DrawBlockStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC ) void DrawBlockStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC ) /**************************************************************/ /**************************************************************/ { { int w = GetWidth() / panel->GetZoom(); int w = panel->GetScreen()->Scale( GetWidth() ); int h = GetHeight() / panel->GetZoom(); int h = panel->GetScreen()->Scale( GetHeight() ); if( w == 0 || h == 0 ) if( w == 0 || h == 0 ) GRLine( &panel->m_ClipBox, DC, GetX(), GetY(), GRLine( &panel->m_ClipBox, DC, GetX(), GetY(), Loading