So i'm probably just overlooking something very obvious here, but basically I have a for loop inside the event loop. There's a switch and under the case of left clicking there is a for loop. After the for loop there is an if statement and the program seems to completely ignore the for loop and jumps straight to the if statement.
case sf::Event::MouseButtonPressed: // the left click case in the switch
if(event.mouseButton.button == sf::Mouse::Left)
{
for(int i = 0; i < circles.size(); i++) //the for loop
{
if(circles[i].getGlobalBounds().contains(mouseCoords))
{
Circle newCircle;
int radius = circles[i].getCircleRadius();
std::cout<<"Hello"<<std::endl;
circles.pop_back();
newCircle.CreateCircle(placementCoords, radius, r, g, b, 124, 170, 204);
circles.push_back(newCircle);
}
}
//if requarments are met a new instance of shapes will be created, then given info(position, color, etc..) and be saved into a vector
if(canvas.getGlobalBounds().contains(mouseCoords)) //if statement I was talking about
{
Circle newCircle;
newCircle.CreateCircle(mouseCoords, defaultRadius, 176, 214, 242, 124, 170, 204);
circles.push_back(newCircle);
placementCoords = mouseCoords;
selectingSize = true;
}
}