diff options
-rw-r--r-- | src/PatchageModule.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/PatchageModule.h b/src/PatchageModule.h index f9f8d11..7c27d4e 100644 --- a/src/PatchageModule.h +++ b/src/PatchageModule.h @@ -74,6 +74,10 @@ public: virtual void load_location() { + boost::shared_ptr<FlowCanvas> canvas = _canvas.lock(); + if (!canvas) + return; + Coord loc = _app->state_manager()->get_module_location(_name, _type); //cerr << "******" << _name << " MOVING TO (" << loc.x << "," << loc.y << ")" << endl; @@ -81,8 +85,8 @@ public: if (loc.x != -1) move_to(loc.x, loc.y); else - move_to((_canvas.lock()->width()/2) - 100 + rand() % 400, - (_canvas.lock()->height()/2) - 100 + rand() % 400); + move_to((canvas->width()/2) - 100 + rand() % 400, + (canvas->height()/2) - 100 + rand() % 400); } void split() { |