summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-10-04 11:08:39 +0200
committerjmoenig <jens@moenig.org>2013-10-04 11:08:39 +0200
commit4e501e00ad6185fb631d4c6851dfd5383fdc19b7 (patch)
treed21b05adb018bbae0fc1b5a5a1deeb8fd1034cee
parentb32ed8ef2392570cbfbf09a474d02c14ee12fd81 (diff)
downloadsnap-yow-4e501e00ad6185fb631d4c6851dfd5383fdc19b7.tar.gz
snap-yow-4e501e00ad6185fb631d4c6851dfd5383fdc19b7.zip
Keep watchers onstage when hiding/showing them, fixes #195
-rwxr-xr-xhistory.txt1
-rw-r--r--objects.js4
2 files changed, 5 insertions, 0 deletions
diff --git a/history.txt b/history.txt
index 26d93d4..d3b210b 100755
--- a/history.txt
+++ b/history.txt
@@ -1938,3 +1938,4 @@ ______
------
* Threads: Type-check the SPLIT block's input before eval'ing it
* Objects: Prevent watcher cells from growing wider as their contents becomes taller
+* Objects: Keep watchers onstage when hiding/showing them, fixes #195
diff --git a/objects.js b/objects.js
index 72cdffa..dfdd826 100644
--- a/objects.js
+++ b/objects.js
@@ -3056,6 +3056,7 @@ SpriteMorph.prototype.toggleVariableWatcher = function (varName, isGlobal) {
} else {
watcher.show();
watcher.fixLayout(); // re-hide hidden parts
+ watcher.keepWithin(stage);
}
return;
}
@@ -3074,6 +3075,7 @@ SpriteMorph.prototype.toggleVariableWatcher = function (varName, isGlobal) {
}
stage.add(watcher);
watcher.fixLayout();
+ watcher.keepWithin(stage);
};
SpriteMorph.prototype.showingVariableWatcher = function (varName) {
@@ -3115,6 +3117,7 @@ SpriteMorph.prototype.toggleWatcher = function (selector, label, color) {
} else {
watcher.show();
watcher.fixLayout(); // re-hide hidden parts
+ watcher.keepWithin(stage);
}
return;
}
@@ -3133,6 +3136,7 @@ SpriteMorph.prototype.toggleWatcher = function (selector, label, color) {
}
stage.add(watcher);
watcher.fixLayout();
+ watcher.keepWithin(stage);
};
SpriteMorph.prototype.showingWatcher = function (selector) {