From effdb0444077112805c9e3c276bb2d68df8333b5 Mon Sep 17 00:00:00 2001 From: Michael Aschauer Date: Wed, 31 Oct 2018 23:16:38 +0100 Subject: [PATCH] fix removed commands --- stitchcode/blocks.js | 10 +++++----- stitchcode/objects.js | 18 +++++++++++------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/stitchcode/blocks.js b/stitchcode/blocks.js index 7a19b8a3..c22a0476 100644 --- a/stitchcode/blocks.js +++ b/stitchcode/blocks.js @@ -57,15 +57,15 @@ SymbolMorph.prototype.drawSymbolZoomToFit = function (canvas, color) { ctx.strokeStyle = color.toString(); ctx.lineWidth = 1.5; - - + + ctx.moveTo(0, 0); ctx.lineTo(w, 0); ctx.stroke(); ctx.moveTo(0, 0); ctx.lineTo(0, w); ctx.stroke(); - + ctx.moveTo(0, h); ctx.lineTo(0, h - w); ctx.stroke(); @@ -79,13 +79,13 @@ SymbolMorph.prototype.drawSymbolZoomToFit = function (canvas, color) { ctx.moveTo(h, 0); ctx.lineTo(h, w); ctx.stroke(); - + ctx.moveTo(h, h); ctx.lineTo(h - w, h); ctx.stroke(); ctx.moveTo(h, h); ctx.lineTo(h, h - w); - ctx.stroke(); + ctx.stroke(); return canvas; }; diff --git a/stitchcode/objects.js b/stitchcode/objects.js index 502d1e40..5d8a6b43 100644 --- a/stitchcode/objects.js +++ b/stitchcode/objects.js @@ -2008,16 +2008,17 @@ SpriteMorph.prototype.initBlocks = function () { { type: 'command', spec: 'zoom to fit', - category: 'sensing' + category: 'other' }; - this.blocks.reportPi = { - type: 'reporter', - category: 'operators', - spec: 'PI', - }; + this.blocks.reportPi = { + type: 'reporter', + category: 'operators', + spec: 'PI', + }; }; +SpriteMorph.prototype.initBlocks(); // SpriteMorph block templates @@ -2248,6 +2249,9 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('tieStitch')); blocks.push('-'); + } else if (cat === 'other') { + blocks.push(block('zoomToFit')); + } else if (cat === 'colors') { blocks.push(block('setColor')); blocks.push('-'); @@ -2360,7 +2364,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push('-'); blocks.push(block('reportDate')); blocks.push('-'); - blocks.push(block('zoomToFit')); + // for debugging: ///////////////