Commit 12dfd80f authored by CHARRAS's avatar CHARRAS

see changelog

parent f85ade75
...@@ -52,7 +52,7 @@ static wxPoint s_CornerInitialPosition; // Used to abort ...@@ -52,7 +52,7 @@ static wxPoint s_CornerInitialPosition; // Used to abort
static bool s_CornerIsNew; // Used to abort a move corner command (if it is a new corner, it must be deleted) static bool s_CornerIsNew; // Used to abort a move corner command (if it is a new corner, it must be deleted)
static bool s_AddCutoutToCurrentZone; // if true, the next outline will be addes to s_CurrentZone static bool s_AddCutoutToCurrentZone; // if true, the next outline will be addes to s_CurrentZone
static ZONE_CONTAINER* s_CurrentZone; // if != NULL, these ZONE_CONTAINER params will be used for the next zone static ZONE_CONTAINER* s_CurrentZone; // if != NULL, these ZONE_CONTAINER params will be used for the next zone
static wxPoint s_CursorLastPosition; // in move zone outline, last cursor position. Used to calculate the move vector
// keys used to store net sort option in config file : // keys used to store net sort option in config file :
#define ZONE_NET_OUTLINES_HATCH_OPTION_KEY wxT( "Zone_Ouline_Hatch_Opt" ) #define ZONE_NET_OUTLINES_HATCH_OPTION_KEY wxT( "Zone_Ouline_Hatch_Opt" )
#define ZONE_NET_SORT_OPTION_KEY wxT( "Zone_NetSort_Opt" ) #define ZONE_NET_SORT_OPTION_KEY wxT( "Zone_NetSort_Opt" )
...@@ -297,8 +297,7 @@ void WinEDA_PcbFrame::Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_c ...@@ -297,8 +297,7 @@ void WinEDA_PcbFrame::Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_c
zone_container->m_Flags = IS_MOVED; zone_container->m_Flags = IS_MOVED;
DrawPanel->ManageCurseur = Show_Zone_Corner_Or_Outline_While_Move_Mouse; DrawPanel->ManageCurseur = Show_Zone_Corner_Or_Outline_While_Move_Mouse;
DrawPanel->ForceCloseManageCurseur = Abort_Zone_Move_Corner_Or_Outlines; DrawPanel->ForceCloseManageCurseur = Abort_Zone_Move_Corner_Or_Outlines;
s_CornerInitialPosition.x = zone_container->m_Poly->GetX( 0 ); s_CursorLastPosition = s_CornerInitialPosition = GetScreen()->m_Curseur;
s_CornerInitialPosition.y = zone_container->m_Poly->GetY( 0 );
s_CornerIsNew = false; s_CornerIsNew = false;
s_AddCutoutToCurrentZone = false; s_AddCutoutToCurrentZone = false;
s_CurrentZone = NULL; s_CurrentZone = NULL;
...@@ -428,8 +427,7 @@ void Abort_Zone_Move_Corner_Or_Outlines( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -428,8 +427,7 @@ void Abort_Zone_Move_Corner_Or_Outlines( WinEDA_DrawPanel* Panel, wxDC* DC )
if ( zone_container->m_Flags == IS_MOVED ) if ( zone_container->m_Flags == IS_MOVED )
{ {
wxPoint offset; wxPoint offset;
offset.x = s_CornerInitialPosition.x - zone_container->m_Poly->GetX( 0 ); offset = s_CornerInitialPosition - s_CursorLastPosition;
offset.y = s_CornerInitialPosition.y - zone_container->m_Poly->GetY( 0 );
zone_container->Move(offset); zone_container->Move(offset);
} }
else else
...@@ -474,9 +472,10 @@ void Show_Zone_Corner_Or_Outline_While_Move_Mouse( WinEDA_DrawPanel* Panel, wxDC ...@@ -474,9 +472,10 @@ void Show_Zone_Corner_Or_Outline_While_Move_Mouse( WinEDA_DrawPanel* Panel, wxDC
if( zone_container->m_Flags == IS_MOVED ) if( zone_container->m_Flags == IS_MOVED )
{ {
wxPoint offset; wxPoint offset;
offset.x = pos.x - zone_container->m_Poly->GetX( 0 ); offset.x = pos.x - s_CursorLastPosition.x;
offset.y = pos.y - zone_container->m_Poly->GetY( 0 ); offset.y = pos.y - s_CursorLastPosition.y;
zone_container->Move(offset); zone_container->Move(offset);
s_CursorLastPosition = pos;
} }
else else
zone_container->m_Poly->MoveCorner( zone_container->m_CornerSelection, pos.x, pos.y ); zone_container->m_Poly->MoveCorner( zone_container->m_CornerSelection, pos.x, pos.y );
......
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