当前位置: 首页>>代码示例>>C++>>正文


C++ URect::intersection方法代码示例

本文整理汇总了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();
}
开发者ID:lenmus,项目名称:lomse,代码行数:8,代码来源:lomse_chord_engraver.cpp

示例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);
    }
}
开发者ID:lenmus,项目名称:lomse,代码行数:41,代码来源:lomse_articulation_engraver.cpp

示例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();
}
开发者ID:lenmus,项目名称:lomse,代码行数:7,代码来源:lomse_chord_engraver.cpp


注:本文中的URect::intersection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。