diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index ee1d00486c..7f7c460376 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -1293,12 +1293,10 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) if( selection.Empty() ) return 0; - OPT oldRefPt; + OPT oldRefPt = boost::make_optional( false, VECTOR2I( 0, 0 ) ); if( selection.HasReferencePoint() ) oldRefPt = selection.GetReferencePoint(); - else - oldRefPt = NULLOPT; updateModificationPoint( selection ); @@ -1342,7 +1340,7 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) // Restore the old reference so any mouse dragging that occurs doesn't make the selection jump // to this now invalid reference - if( oldRefPt != NULLOPT ) + if( oldRefPt ) selection.SetReferencePoint( *oldRefPt ); else selection.ClearReferencePoint(); @@ -1549,12 +1547,10 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent ) if( selection.Empty() ) return 0; - OPT oldRefPt; + OPT oldRefPt = boost::make_optional( false, VECTOR2I( 0, 0 ) ); if( selection.HasReferencePoint() ) oldRefPt = selection.GetReferencePoint(); - else - oldRefPt = NULLOPT; updateModificationPoint( selection ); @@ -1606,7 +1602,7 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent ) // Restore the old reference so any mouse dragging that occurs doesn't make the selection jump // to this now invalid reference - if( oldRefPt != NULLOPT ) + if( oldRefPt ) selection.SetReferencePoint( *oldRefPt ); else selection.ClearReferencePoint();