Allow zone drawing tool to start a new zone in the previous zone last point.

This commit is contained in:
Maciej Suminski 2015-07-28 17:33:18 +02:00
parent 3d17807fcc
commit 5402bf0960
1 changed files with 1 additions and 4 deletions

View File

@ -1038,7 +1038,6 @@ int DRAWING_TOOL::drawZone( bool aKeepout )
Activate(); Activate();
VECTOR2I lastCursorPos = m_controls->GetCursorPosition();
VECTOR2I origin; VECTOR2I origin;
int numPoints = 0; int numPoints = 0;
bool direction45 = false; // 45 degrees only mode bool direction45 = false; // 45 degrees only mode
@ -1098,7 +1097,7 @@ int DRAWING_TOOL::drawZone( bool aKeepout )
else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) ) else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) )
{ {
// Check if it is double click / closing line (so we have to finish the zone) // Check if it is double click / closing line (so we have to finish the zone)
if( evt->IsDblClick( BUT_LEFT ) || lastCursorPos == cursorPos || ( numPoints > 0 && cursorPos == origin ) ) if( evt->IsDblClick( BUT_LEFT ) || ( numPoints > 0 && cursorPos == origin ) )
{ {
if( numPoints > 2 ) // valid zone consists of more than 2 points if( numPoints > 2 ) // valid zone consists of more than 2 points
{ {
@ -1207,8 +1206,6 @@ int DRAWING_TOOL::drawZone( bool aKeepout )
++numPoints; ++numPoints;
updatePreview = true; updatePreview = true;
} }
lastCursorPos = cursorPos;
} }
else if( evt->IsMotion() && numPoints > 0 ) else if( evt->IsMotion() && numPoints > 0 )