Browse Source

Fix crashing on vertex click after deselect

This was a nasty long-timer bug. A lot of unfortunate crashes before autosave was there. It
usually happened when one was trying to click on the selected surface vertex, failed and
then tried again. The selection widget joints were still hitTested, but as there was no
selection anymore, the app crashed while trying to access a vertex of a non-existing
surface.
master
Krisjanis Rijnieks 9 years ago
parent
commit
3f1bc1520e
  1. 3
      src/Gui/Widgets/ProjectionEditorWidget.cpp

3
src/Gui/Widgets/ProjectionEditorWidget.cpp

@ -195,6 +195,9 @@ void ProjectionEditorWidget::setSnapDistance(float newSnapDistance){
}
CircleJoint * ProjectionEditorWidget::hitTestJoints(ofVec2f pos){
if(surfaceManager->getSelectedSurface() == 0){
return 0;
}
for(int i = 0; i < joints.size(); i++){
if(joints[i]->hitTest(pos)){
return joints[i];

Loading…
Cancel
Save