Loading common/base_screen.cpp +10 −6 Original line number Original line Diff line number Diff line Loading @@ -154,11 +154,8 @@ int BASE_SCREEN::Scale( int coord ) #ifdef WX_ZOOM #ifdef WX_ZOOM return coord; return coord; #else #else if( !m_Zoom ) return 0; if( !m_ZoomScalar || !m_Zoom ) if( !m_ZoomScalar || !m_Zoom ) return 0; return coord; return wxRound( (double) ( coord * m_ZoomScalar ) / (double) m_Zoom ); return wxRound( (double) ( coord * m_ZoomScalar ) / (double) m_Zoom ); #endif #endif Loading @@ -173,8 +170,15 @@ void BASE_SCREEN::Scale( wxPoint& pt ) void BASE_SCREEN::Scale( wxRealPoint& pt ) void BASE_SCREEN::Scale( wxRealPoint& pt ) { { pt.x = Scale( pt.x ); #ifdef WX_ZOOM pt.y = Scale( pt.y ); // No change #else if( !m_ZoomScalar || !m_Zoom ) return; pt.x = pt.x * m_ZoomScalar / (double) m_Zoom; pt.y = pt.y * m_ZoomScalar / (double) m_Zoom; #endif } } Loading common/edaappl.cpp +4 −3 Original line number Original line Diff line number Diff line Loading @@ -442,15 +442,16 @@ bool WinEDA_App::SetBinDir() m_BinDir = argv[0]; m_BinDir = argv[0]; #endif /* __UNIX__ */ #endif /* __UNIX__ */ while( m_BinDir.Last() != DIR_SEP ) m_BinDir.RemoveLast(); /* Use unix notation for paths. I am not sure this is a good idea, /* Use unix notation for paths. I am not sure this is a good idea, * but it simplify compatibility between Windows and Unices * but it simplify compatibility between Windows and Unices * However it is a potential problem in path handling under Windows * However it is a potential problem in path handling under Windows */ */ m_BinDir.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP ); m_BinDir.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP ); // Remove filename form command line: while( m_BinDir.Last() != '/' ) m_BinDir.RemoveLast(); wxFileName pfn( wxT( "/posix/path/specification" ), wxT( "filename" ) ); wxFileName pfn( wxT( "/posix/path/specification" ), wxT( "filename" ) ); wxFileName wfn( wxT( "\\windows\\path\\specification" ), wxT( "filename" ) ); wxFileName wfn( wxT( "\\windows\\path\\specification" ), wxT( "filename" ) ); wxLogDebug( wxT( "Posix path: " ) + pfn.GetFullPath() ); wxLogDebug( wxT( "Posix path: " ) + pfn.GetFullPath() ); Loading common/zoom.cpp +3 −5 Original line number Original line Diff line number Diff line Loading @@ -51,10 +51,8 @@ void WinEDA_DrawFrame::PutOnGrid( wxPoint* coord ) if( !GetBaseScreen()->m_UserGridIsON ) if( !GetBaseScreen()->m_UserGridIsON ) { { coord->x = ( (int) round( coord->x / coord->x = (int) round( ( coord->x / grid_size.x ) * grid_size.x ); grid_size.x ) ) * grid_size.x; coord->y = (int) round( ( coord->y / grid_size.y ) * grid_size.y ); coord->y = ( (int) round( coord->y / grid_size.y ) ) * grid_size.y; } } } } Loading Loading @@ -246,7 +244,7 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu ) for( i = 0; i < GetScreen()->m_GridList.GetCount(); i++ ) for( i = 0; i < GetScreen()->m_GridList.GetCount(); i++ ) { { tmp = GetScreen()->m_GridList[i]; tmp = GetScreen()->m_GridList[i]; gridValue = To_User_Unit( g_UnitMetric, tmp.m_Size.x, gridValue = To_User_Unit( g_UnitMetric, (int) round(tmp.m_Size.x), ( (WinEDA_DrawFrame*)m_Parent )->m_InternalUnits ); ( (WinEDA_DrawFrame*)m_Parent )->m_InternalUnits ); if( tmp.m_Id == ID_POPUP_GRID_USER ) if( tmp.m_Id == ID_POPUP_GRID_USER ) { { Loading cvpcb/displayframe.cpp +4 −4 Original line number Original line Diff line number Diff line Loading @@ -234,25 +234,25 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) case WXK_NUMPAD8: /* cursor moved up */ case WXK_NUMPAD8: /* cursor moved up */ case WXK_UP: case WXK_UP: Mouse.y -= delta.y; Mouse.y -= (int) round(delta.y); DrawPanel->MouseTo( Mouse ); DrawPanel->MouseTo( Mouse ); break; break; case WXK_NUMPAD2: /* cursor moved down */ case WXK_NUMPAD2: /* cursor moved down */ case WXK_DOWN: case WXK_DOWN: Mouse.y += delta.y; Mouse.y += (int) round(delta.y); DrawPanel->MouseTo( Mouse ); DrawPanel->MouseTo( Mouse ); break; break; case WXK_NUMPAD4: /* cursor moved left */ case WXK_NUMPAD4: /* cursor moved left */ case WXK_LEFT: case WXK_LEFT: Mouse.x -= delta.x; Mouse.x -= (int) round(delta.x); DrawPanel->MouseTo( Mouse ); DrawPanel->MouseTo( Mouse ); break; break; case WXK_NUMPAD6: /* cursor moved right */ case WXK_NUMPAD6: /* cursor moved right */ case WXK_RIGHT: case WXK_RIGHT: Mouse.x += delta.x; Mouse.x += (int) round(delta.x); DrawPanel->MouseTo( Mouse ); DrawPanel->MouseTo( Mouse ); break; break; } } Loading eeschema/controle.cpp +12 −12 Original line number Original line Diff line number Diff line Loading @@ -248,25 +248,25 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_UP: case WXK_UP: MousePositionInPixels.y -= delta.y; MousePositionInPixels.y -= (int) round(delta.y); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_DOWN: case WXK_DOWN: MousePositionInPixels.y += delta.y; MousePositionInPixels.y += (int) round(delta.y); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_LEFT: case WXK_LEFT: MousePositionInPixels.x -= delta.x; MousePositionInPixels.x -= (int) round(delta.x); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_RIGHT: case WXK_RIGHT: MousePositionInPixels.x += delta.x; MousePositionInPixels.x += (int) round(delta.x); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; Loading Loading @@ -342,25 +342,25 @@ void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixe case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_UP: case WXK_UP: MousePositionInPixels.y -= delta.y; MousePositionInPixels.y -= (int) round(delta.y); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_DOWN: case WXK_DOWN: MousePositionInPixels.y += delta.y; MousePositionInPixels.y += (int) round(delta.y); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_LEFT: case WXK_LEFT: MousePositionInPixels.x -= delta.x; MousePositionInPixels.x -= (int) round(delta.x); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_RIGHT: case WXK_RIGHT: MousePositionInPixels.x += delta.x; MousePositionInPixels.x += (int) round(delta.x); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; Loading Loading @@ -436,25 +436,25 @@ void WinEDA_ViewlibFrame::GeneralControle( wxDC* DC, case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_UP: case WXK_UP: MousePositionInPixels.y -= delta.y; MousePositionInPixels.y -= (int) round(delta.y); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_DOWN: case WXK_DOWN: MousePositionInPixels.y += delta.y; MousePositionInPixels.y += (int) round(delta.y); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_LEFT: case WXK_LEFT: MousePositionInPixels.x -= delta.x; MousePositionInPixels.x -= (int) round(delta.x); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_RIGHT: case WXK_RIGHT: MousePositionInPixels.x += delta.x; MousePositionInPixels.x += (int) round(delta.x); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; Loading Loading
common/base_screen.cpp +10 −6 Original line number Original line Diff line number Diff line Loading @@ -154,11 +154,8 @@ int BASE_SCREEN::Scale( int coord ) #ifdef WX_ZOOM #ifdef WX_ZOOM return coord; return coord; #else #else if( !m_Zoom ) return 0; if( !m_ZoomScalar || !m_Zoom ) if( !m_ZoomScalar || !m_Zoom ) return 0; return coord; return wxRound( (double) ( coord * m_ZoomScalar ) / (double) m_Zoom ); return wxRound( (double) ( coord * m_ZoomScalar ) / (double) m_Zoom ); #endif #endif Loading @@ -173,8 +170,15 @@ void BASE_SCREEN::Scale( wxPoint& pt ) void BASE_SCREEN::Scale( wxRealPoint& pt ) void BASE_SCREEN::Scale( wxRealPoint& pt ) { { pt.x = Scale( pt.x ); #ifdef WX_ZOOM pt.y = Scale( pt.y ); // No change #else if( !m_ZoomScalar || !m_Zoom ) return; pt.x = pt.x * m_ZoomScalar / (double) m_Zoom; pt.y = pt.y * m_ZoomScalar / (double) m_Zoom; #endif } } Loading
common/edaappl.cpp +4 −3 Original line number Original line Diff line number Diff line Loading @@ -442,15 +442,16 @@ bool WinEDA_App::SetBinDir() m_BinDir = argv[0]; m_BinDir = argv[0]; #endif /* __UNIX__ */ #endif /* __UNIX__ */ while( m_BinDir.Last() != DIR_SEP ) m_BinDir.RemoveLast(); /* Use unix notation for paths. I am not sure this is a good idea, /* Use unix notation for paths. I am not sure this is a good idea, * but it simplify compatibility between Windows and Unices * but it simplify compatibility between Windows and Unices * However it is a potential problem in path handling under Windows * However it is a potential problem in path handling under Windows */ */ m_BinDir.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP ); m_BinDir.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP ); // Remove filename form command line: while( m_BinDir.Last() != '/' ) m_BinDir.RemoveLast(); wxFileName pfn( wxT( "/posix/path/specification" ), wxT( "filename" ) ); wxFileName pfn( wxT( "/posix/path/specification" ), wxT( "filename" ) ); wxFileName wfn( wxT( "\\windows\\path\\specification" ), wxT( "filename" ) ); wxFileName wfn( wxT( "\\windows\\path\\specification" ), wxT( "filename" ) ); wxLogDebug( wxT( "Posix path: " ) + pfn.GetFullPath() ); wxLogDebug( wxT( "Posix path: " ) + pfn.GetFullPath() ); Loading
common/zoom.cpp +3 −5 Original line number Original line Diff line number Diff line Loading @@ -51,10 +51,8 @@ void WinEDA_DrawFrame::PutOnGrid( wxPoint* coord ) if( !GetBaseScreen()->m_UserGridIsON ) if( !GetBaseScreen()->m_UserGridIsON ) { { coord->x = ( (int) round( coord->x / coord->x = (int) round( ( coord->x / grid_size.x ) * grid_size.x ); grid_size.x ) ) * grid_size.x; coord->y = (int) round( ( coord->y / grid_size.y ) * grid_size.y ); coord->y = ( (int) round( coord->y / grid_size.y ) ) * grid_size.y; } } } } Loading Loading @@ -246,7 +244,7 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu ) for( i = 0; i < GetScreen()->m_GridList.GetCount(); i++ ) for( i = 0; i < GetScreen()->m_GridList.GetCount(); i++ ) { { tmp = GetScreen()->m_GridList[i]; tmp = GetScreen()->m_GridList[i]; gridValue = To_User_Unit( g_UnitMetric, tmp.m_Size.x, gridValue = To_User_Unit( g_UnitMetric, (int) round(tmp.m_Size.x), ( (WinEDA_DrawFrame*)m_Parent )->m_InternalUnits ); ( (WinEDA_DrawFrame*)m_Parent )->m_InternalUnits ); if( tmp.m_Id == ID_POPUP_GRID_USER ) if( tmp.m_Id == ID_POPUP_GRID_USER ) { { Loading
cvpcb/displayframe.cpp +4 −4 Original line number Original line Diff line number Diff line Loading @@ -234,25 +234,25 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) case WXK_NUMPAD8: /* cursor moved up */ case WXK_NUMPAD8: /* cursor moved up */ case WXK_UP: case WXK_UP: Mouse.y -= delta.y; Mouse.y -= (int) round(delta.y); DrawPanel->MouseTo( Mouse ); DrawPanel->MouseTo( Mouse ); break; break; case WXK_NUMPAD2: /* cursor moved down */ case WXK_NUMPAD2: /* cursor moved down */ case WXK_DOWN: case WXK_DOWN: Mouse.y += delta.y; Mouse.y += (int) round(delta.y); DrawPanel->MouseTo( Mouse ); DrawPanel->MouseTo( Mouse ); break; break; case WXK_NUMPAD4: /* cursor moved left */ case WXK_NUMPAD4: /* cursor moved left */ case WXK_LEFT: case WXK_LEFT: Mouse.x -= delta.x; Mouse.x -= (int) round(delta.x); DrawPanel->MouseTo( Mouse ); DrawPanel->MouseTo( Mouse ); break; break; case WXK_NUMPAD6: /* cursor moved right */ case WXK_NUMPAD6: /* cursor moved right */ case WXK_RIGHT: case WXK_RIGHT: Mouse.x += delta.x; Mouse.x += (int) round(delta.x); DrawPanel->MouseTo( Mouse ); DrawPanel->MouseTo( Mouse ); break; break; } } Loading
eeschema/controle.cpp +12 −12 Original line number Original line Diff line number Diff line Loading @@ -248,25 +248,25 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_UP: case WXK_UP: MousePositionInPixels.y -= delta.y; MousePositionInPixels.y -= (int) round(delta.y); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_DOWN: case WXK_DOWN: MousePositionInPixels.y += delta.y; MousePositionInPixels.y += (int) round(delta.y); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_LEFT: case WXK_LEFT: MousePositionInPixels.x -= delta.x; MousePositionInPixels.x -= (int) round(delta.x); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_RIGHT: case WXK_RIGHT: MousePositionInPixels.x += delta.x; MousePositionInPixels.x += (int) round(delta.x); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; Loading Loading @@ -342,25 +342,25 @@ void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixe case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_UP: case WXK_UP: MousePositionInPixels.y -= delta.y; MousePositionInPixels.y -= (int) round(delta.y); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_DOWN: case WXK_DOWN: MousePositionInPixels.y += delta.y; MousePositionInPixels.y += (int) round(delta.y); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_LEFT: case WXK_LEFT: MousePositionInPixels.x -= delta.x; MousePositionInPixels.x -= (int) round(delta.x); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_RIGHT: case WXK_RIGHT: MousePositionInPixels.x += delta.x; MousePositionInPixels.x += (int) round(delta.x); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; Loading Loading @@ -436,25 +436,25 @@ void WinEDA_ViewlibFrame::GeneralControle( wxDC* DC, case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_UP: case WXK_UP: MousePositionInPixels.y -= delta.y; MousePositionInPixels.y -= (int) round(delta.y); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_DOWN: case WXK_DOWN: MousePositionInPixels.y += delta.y; MousePositionInPixels.y += (int) round(delta.y); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_LEFT: case WXK_LEFT: MousePositionInPixels.x -= delta.x; MousePositionInPixels.x -= (int) round(delta.x); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_RIGHT: case WXK_RIGHT: MousePositionInPixels.x += delta.x; MousePositionInPixels.x += (int) round(delta.x); DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels ); break; break; Loading