correct display of XRay checkbox

pull/68/head
Michael Aschauer 2019-01-16 22:47:24 -08:00
rodzic 6bd731b4b6
commit 1db69bd4a1
2 zmienionych plików z 34 dodań i 27 usunięć

Wyświetl plik

@ -1031,9 +1031,9 @@ IDE_Morph.prototype.aboutTurtleStitch = function () {
IDE_Morph.prototype.createStatusDisplay = function () { IDE_Morph.prototype.createStatusDisplay = function () {
var frame, var frame,
padding = 1, padding = 1,
myself = this, myself = this,
elements = [], elements = [],
stage = this.stage; stage = this.stage;
if (this.statusDisplay) { if (this.statusDisplay) {
this.statusDisplay.destroy(); this.statusDisplay.destroy();
@ -1254,31 +1254,35 @@ IDE_Morph.prototype.createStatusDisplay = function () {
resetCameraButton.columns = 4; resetCameraButton.columns = 4;
resetCameraButton.newColumn = 2; resetCameraButton.newColumn = 2;
var XRayButton = new ToggleMorph( var XRayButton = new ToggleMorph(
'checkbox', 'checkbox',
null, null,
function () { function () {
if (stage.isXRay) { if (stage.isXRay) {
myself.showMessage("turn off X-RAY ..."); myself.showMessage("turn off X-RAY ...");
window.setTimeout( window.setTimeout(
function() { function() {
stage.turnXRayOff(); stage.turnXRayOff();
myself.showMessage("done",0.4); myself.showMessage("done",0.4);
}, 250); myself.XRayButton.refresh();
} else { }, 250);
myself.showMessage("rendering X-RAY ..."); } else {
window.setTimeout( myself.showMessage("rendering X-RAY ...");
function() { window.setTimeout(
stage.turnXRayOn(); function() {
myself.showMessage("done", 0.4); stage.turnXRayOn();
} ,250); myself.showMessage("done", 0.4);
} myself.XRayButton.refresh();
}, } ,250);
'X-Ray', }
function () { },
return stage.isXRay; 'X-Ray',
}); function () {
return stage.getIsXRay();
});
elements.push(XRayButton); elements.push(XRayButton);
myself.XRayButton = XRayButton;
XRayButton.columns = 4; XRayButton.columns = 4;
XRayButton.newColumn = 3; XRayButton.newColumn = 3;

Wyświetl plik

@ -2859,7 +2859,6 @@ StageMorph.prototype.turnXRayOn = function () {
this.children[0].addStitch(stitch[0][0], stitch[0][1], stitch[1][0], stitch[1][1], angle) this.children[0].addStitch(stitch[0][0], stitch[0][1], stitch[1][0], stitch[1][1], angle)
} }
this.renderer.changed = true; this.renderer.changed = true;
} }
@ -2908,6 +2907,10 @@ StageMorph.prototype.turnXRayOff = function () {
} }
StageMorph.prototype.getIsXRay = function () {
return this.isXRay;
}
StageMorph.prototype.clearPenTrails = nop; StageMorph.prototype.clearPenTrails = nop;
StageMorph.prototype.penTrails = function () { StageMorph.prototype.penTrails = function () {