draw a subtle outline around the stage in presentation mode

pull/95/head
jmoenig 2020-05-04 00:01:51 +02:00
rodzic 485c33da90
commit 9aecdec548
1 zmienionych plików z 24 dodań i 1 usunięć

Wyświetl plik

@ -78,7 +78,7 @@ Animation, BoxMorph, BlockEditorMorph, BlockDialogMorph, Note*/
// Global stuff ////////////////////////////////////////////////////////
modules.gui = '2020-May-03';
modules.gui = '2020-May-04';
// Declarations
@ -1941,6 +1941,29 @@ IDE_Morph.prototype.setExtent = function (point) {
this.fixLayout();
};
// IDE_Morph rendering
IDE_Morph.prototype.render = function (ctx) {
var frame;
IDE_Morph.uber.render.call(this, ctx);
if (this.isAppMode && this.stage) {
// draw a subtle outline rectangle around the stage
// in presentation mode
frame = this.stage.bounds.translateBy(
this.position().neg()
).expandBy(2);
ctx.strokeStyle = this.backgroundColor.toString();
ctx.lineWidth = 1;
ctx.beginPath();
ctx.moveTo(frame.origin.x, frame.origin.y);
ctx.lineTo(frame.corner.x, frame.origin.y);
ctx.lineTo(frame.corner.x, frame.corner.y);
ctx.lineTo(frame.origin.x, frame.corner.y);
ctx.closePath();
ctx.stroke();
}
};
// IDE_Morph events
IDE_Morph.prototype.reactToWorldResize = function (rect) {