本文整理汇总了C++中URect::intersection方法的典型用法代码示例。如果您正苦于以下问题:C++ URect::intersection方法的具体用法?C++ URect::intersection怎么用?C++ URect::intersection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URect
的用法示例。
在下文中一共展示了URect::intersection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check_if_accidentals_overlap
//---------------------------------------------------------------------------------------
LUnits ChordEngraver::check_if_accidentals_overlap(GmoShapeAccidentals* pPrevAcc,
GmoShapeAccidentals* pCurAcc)
{
URect overlap = pPrevAcc->get_bounds();
overlap.intersection( pCurAcc->get_bounds() );
return overlap.get_width();
}
示例2: center_on_parent
//---------------------------------------------------------------------------------------
void ArticulationEngraver::center_on_parent()
{
if (!m_pParentShape)
return;
LUnits uCenterPos;
if (m_pParentShape->is_shape_note())
{
//it is a note. Center articulation on notehead shape
GmoShapeNote* pNote = dynamic_cast<GmoShapeNote*>(m_pParentShape);
uCenterPos = pNote->get_notehead_left() + pNote->get_notehead_width() / 2.0f;
}
else
{
//it is not a note (normally it would be a rest).
//Center articulation on parent shape
uCenterPos = m_pParentShape->get_left() + m_pParentShape->get_width() / 2.0f;
}
LUnits xShift = uCenterPos -
(m_pArticulationShape->get_left() + m_pArticulationShape->get_width() / 2.0f);
if (xShift != 0.0f)
{
USize shift(xShift, 0.0f);
m_pArticulationShape->shift_origin(shift);
}
//ensure that articulation does not collides with parent shape
URect overlap = m_pParentShape->get_bounds();
overlap.intersection( m_pArticulationShape->get_bounds() );
LUnits yShift = overlap.get_height();
if (yShift != 0.0f)
{
yShift += tenths_to_logical(5.0f);
yShift = m_fAbove ? - yShift : yShift;
USize shift(0.0f, yShift);
m_pArticulationShape->shift_origin(shift);
}
}
示例3: check_if_overlap
//---------------------------------------------------------------------------------------
LUnits ChordEngraver::check_if_overlap(GmoShape* pShape, GmoShape* pNewShape)
{
URect overlap = pShape->get_bounds();
overlap.intersection( pNewShape->get_bounds() );
return overlap.get_width();
}