本文整理汇总了C++中TOOL_EVENT::IsMotion方法的典型用法代码示例。如果您正苦于以下问题:C++ TOOL_EVENT::IsMotion方法的具体用法?C++ TOOL_EVENT::IsMotion怎么用?C++ TOOL_EVENT::IsMotion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TOOL_EVENT
的用法示例。
在下文中一共展示了TOOL_EVENT::IsMotion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateStartItem
void TOOL_BASE::updateStartItem( const TOOL_EVENT& aEvent, bool aIgnorePads )
{
int tl = getView()->GetTopLayer();
VECTOR2I cp = controls()->GetCursorPosition( !aEvent.Modifier( MD_SHIFT ) );
VECTOR2I p;
controls()->ForceCursorPosition( false );
m_gridHelper->SetUseGrid( !aEvent.Modifier( MD_ALT ) );
m_gridHelper->SetSnap( !aEvent.Modifier( MD_SHIFT ) );
bool snapEnabled = true;
if( aEvent.IsMotion() || aEvent.IsClick() )
{
snapEnabled = !aEvent.Modifier( MD_SHIFT );
p = aEvent.Position();
}
else
{
p = cp;
}
m_startItem = pickSingleItem( p, -1, -1, aIgnorePads );
if( !snapEnabled && m_startItem && !m_startItem->Layers().Overlaps( tl ) )
m_startItem = nullptr;
m_startSnapPoint = snapToItem( snapEnabled, m_startItem, p );
if( checkSnap( m_startItem ) )
{
controls()->ForceCursorPosition( true, m_startSnapPoint );
}
}
示例2: updateStartItem
void PNS_TOOL_BASE::updateStartItem( TOOL_EVENT& aEvent )
{
int tl = getView()->GetTopLayer();
VECTOR2I cp = m_ctls->GetCursorPosition();
VECTOR2I p;
PNS_ITEM* startItem = NULL;
bool snapEnabled = true;
if( aEvent.IsMotion() || aEvent.IsClick() )
{
snapEnabled = !aEvent.Modifier( MD_SHIFT );
p = aEvent.Position();
}
else
{
p = cp;
}
startItem = pickSingleItem( p );
m_router->EnableSnapping( snapEnabled );
if( !snapEnabled && startItem && !startItem->Layers().Overlaps( tl ) )
startItem = NULL;
if( startItem && startItem->Net() >= 0 )
{
bool dummy;
VECTOR2I psnap = snapToItem( startItem, p, dummy );
if( snapEnabled )
{
m_startSnapPoint = psnap;
m_ctls->ForceCursorPosition( true, psnap );
}
else
{
m_startSnapPoint = cp;
m_ctls->ForceCursorPosition( false );
}
m_startItem = startItem;
}
else
{
m_startItem = NULL;
m_startSnapPoint = cp;
m_ctls->ForceCursorPosition( false );
}
}
示例3: updateEditedPoint
void POINT_EDITOR::updateEditedPoint( const TOOL_EVENT& aEvent )
{
EDIT_POINT* point = m_editedPoint;
if( aEvent.IsMotion() )
{
point = m_editPoints->FindPoint( aEvent.Position() );
}
else if( aEvent.IsDrag( BUT_LEFT ) )
{
point = m_editPoints->FindPoint( aEvent.DragOrigin() );
}
if( m_editedPoint != point )
setEditedPoint( point );
}