kopia lustrzana https://github.com/backface/turtlestitch
draw a subtle outline around the stage in presentation mode
rodzic
485c33da90
commit
9aecdec548
25
src/gui.js
25
src/gui.js
|
@ -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) {
|
||||
|
|
Ładowanie…
Reference in New Issue