summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CanvasModule.cpp7
-rw-r--r--src/Configuration.cpp5
2 files changed, 10 insertions, 2 deletions
diff --git a/src/CanvasModule.cpp b/src/CanvasModule.cpp
index c049346..dc0af4e 100644
--- a/src/CanvasModule.cpp
+++ b/src/CanvasModule.cpp
@@ -115,7 +115,12 @@ CanvasModule::load_location()
if (_app->conf().get_module_location(_name, _type, loc)) {
move_to(loc.x, loc.y);
} else {
- move_to(20 + rand() % 640, 20 + rand() % 480);
+ const double x = 20 + rand() % 640;
+ const double y = 20 + rand() % 480;
+
+ // Move, then store generated location so it is stable
+ move_to(x, y);
+ store_location(x, y);
}
}
diff --git a/src/Configuration.cpp b/src/Configuration.cpp
index 6158702..f667b1b 100644
--- a/src/Configuration.cpp
+++ b/src/Configuration.cpp
@@ -346,9 +346,12 @@ Configuration::save()
const ModuleSettings& settings = s.second;
if (settings.split) {
- if (settings.input_location && settings.output_location) {
+ if (settings.input_location) {
write_module_position(
file, name, "input", *settings.input_location);
+ }
+
+ if (settings.output_location) {
write_module_position(
file, name, "output", *settings.output_location);
}