diff --git a/src/Surfaces/SurfaceManager.cpp b/src/Surfaces/SurfaceManager.cpp index da93a60..5b9c38b 100644 --- a/src/Surfaces/SurfaceManager.cpp +++ b/src/Surfaces/SurfaceManager.cpp @@ -212,6 +212,7 @@ void SurfaceManager::selectVertex(int i){ void SurfaceManager::moveSelectionBy(ofVec2f v){ if(selectedSurface == 0){ + moveAllSurfacesBy(v); return; } @@ -222,7 +223,15 @@ void SurfaceManager::moveSelectionBy(ofVec2f v){ selectedSurface->moveBy(v); } - // TODO: use member variable for this in the future + // TODO: instead of having single selected surface + // we want to have a selection of one or more. + // it could be implemented as vector here. +} + +void SurfaceManager::moveAllSurfacesBy(ofVec2f v){ + for(int i = 0; i < _surfaces.size(); ++i){ + _surfaces[i]->moveBy(v); + } } void SurfaceManager::deselectSurface(){ diff --git a/src/Surfaces/SurfaceManager.h b/src/Surfaces/SurfaceManager.h index 1afc8bc..b452e91 100644 --- a/src/Surfaces/SurfaceManager.h +++ b/src/Surfaces/SurfaceManager.h @@ -49,6 +49,7 @@ class SurfaceManager { void selectVertex(int i); void moveSelectionBy(ofVec2f v); + void moveAllSurfacesBy(ofVec2f v); int size(); int getSelectedVertexIndex();