Skip to content

Commit

Permalink
[tests] small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Mafo369 authored and dlyr committed Jul 15, 2022
1 parent b5de8c9 commit 10be81c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/CurveEditor/CurveEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ void CurveEditor::subdivisionBezier( int vertexIndex,
auto ptE = PointFactory::createPointComponent(
this, clickedPoint, { curveIndex, curveIndex + 1 }, m_pointEntities.size(), Color::Blue() );
m_pointEntities.insert( m_pointEntities.begin() + firstInsertionIdx, ptE );

ptE = PointFactory::createPointComponent(
this, fourthPoint, { curveIndex }, m_pointEntities.size() );
m_pointEntities.insert( m_pointEntities.begin() + firstInsertionIdx, ptE );
Expand All @@ -225,7 +226,6 @@ void CurveEditor::subdivisionBezier( int vertexIndex,
newCtrlPts1.push_back( ctrlPts[3] );

auto curveE = CurveFactory::createCurveComponent( this, newCtrlPts1, m_curveEntities.size() );

m_curveEntities.insert( m_curveEntities.begin() + curveIndex + 1, curveE );

for ( unsigned int i = ( ( curveIndex + 1 ) * 3 + 2 ); i < m_pointEntities.size(); i++ ) {
Expand Down Expand Up @@ -255,12 +255,15 @@ void CurveEditor::addPointAtEnd( const Vector3& worldPos ) {

unsigned int pointIndex = lastIndex + 1;
last->m_curveId.push_back( ( pointIndex / 3 ) );

auto ptC =
PointFactory::createPointComponent( this, ctrlPts[1], { ( pointIndex / 3 ) }, pointIndex );
m_pointEntities.push_back( ptC );
auto eb = PointFactory::createPointComponent(

ptC = PointFactory::createPointComponent(
this, ctrlPts[2], { ( pointIndex / 3 ) }, pointIndex + 1 );
m_pointEntities.push_back( eb );
m_pointEntities.push_back( ptC );

ptC = PointFactory::createPointComponent(
this, ctrlPts[3], { ( pointIndex / 3 ) }, pointIndex + 2, Color::Blue() );
m_pointEntities.push_back( ptC );
Expand Down

0 comments on commit 10be81c

Please sign in to comment.