Example #1
0
/**
 * Function InsertCorner
 * insert a new corner between two existing corners
 * @param ic = index for the insertion point: the corner is inserted AFTER ic
 * @param x, y = coordinates corner to insert
 */
void CPolyLine::InsertCorner( int ic, int x, int y )
{
    UnHatch();

    if( (unsigned) (ic) >= m_CornersList.GetCornersCount() )
    {
        m_CornersList.Append( CPolyPt( x, y ) );
    }
    else
    {
        m_CornersList.InsertCorner(ic, CPolyPt( x, y ) );
    }

    if( (unsigned) (ic + 1) < m_CornersList.GetCornersCount() )
    {
        if( m_CornersList[ic].end_contour )
        {
            m_CornersList[ic + 1].end_contour   = true;
            m_CornersList[ic].end_contour       = false;
        }
    }

    Hatch();
}
Example #2
0
// insert a new corner between two existing corners
//
void CPolyLine::InsertCorner( int ic, int x, int y )
{
	Undraw();
	corner.InsertAt( ic, CPolyPt(x,y) );
	side_style.InsertAt( ic, STRAIGHT );
	m_ncorners++;
	if( ic )
	{
		if( corner[ic-1].end_contour )
		{
			// Extend to the new corner
			corner[ic-1].end_contour = FALSE;
			corner[ic].end_contour = TRUE;
		}
	}
	Draw();
}