From 49cf6d7eac7ad465eab84edb33d1a6fa26104eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Mon, 25 Sep 2017 07:40:16 +0200 Subject: [PATCH] added new "footprints" symbol --- symbols.js | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/symbols.js b/symbols.js index bfbe0900..0d4110c5 100644 --- a/symbols.js +++ b/symbols.js @@ -41,7 +41,7 @@ // Global stuff //////////////////////////////////////////////////////// -modules.symbols = '2017-September-19'; +modules.symbols = '2017-September-25'; var SymbolMorph; @@ -51,8 +51,8 @@ WorldMorph.prototype.customMorphs = function () { return [ new SymbolMorph( - 'location', - 50, + 'footprints', + 18, new Color(250, 250, 250), new Point(-1, -1), new Color(20, 20, 20) @@ -132,7 +132,8 @@ SymbolMorph.prototype.names = [ 'magnifierOutline', 'notes', 'camera', - 'location' + 'location', + 'footprints' ]; // SymbolMorph instance creation: @@ -312,6 +313,8 @@ SymbolMorph.prototype.symbolCanvasColored = function (aColor) { return this.drawSymbolCamera(canvas, aColor); case 'location': return this.drawSymbolLocation(canvas, aColor); + case 'footprints': + return this.drawSymbolFootprints(canvas, aColor); default: return canvas; } @@ -1590,7 +1593,7 @@ SymbolMorph.prototype.drawSymbolCamera = function (canvas, color) { }; SymbolMorph.prototype.drawSymbolLocation = function (canvas, color) { - // answer a canvas showing a camera + // answer a canvas showing a map pin var ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, @@ -1613,3 +1616,42 @@ SymbolMorph.prototype.drawSymbolLocation = function (canvas, color) { return canvas; }; + +SymbolMorph.prototype.drawSymbolFootprints = function (canvas, color) { + // answer a canvas showing a pair of (shoe) footprints + var ctx = canvas.getContext('2d'), + w = canvas.width, + u = w / 10, + r = u * 1.5; + + ctx.fillStyle = color.toString(); + + // left shoe + // tip + ctx.beginPath(); + ctx.arc(r, r, r, radians(-200), radians(0), false); + ctx.lineTo(r * 2, u * 5.5); + ctx.lineTo(u, u * 6); + ctx.closePath(); + ctx.fill(); + // heel + ctx.beginPath(); + ctx.arc(u * 2.25, u * 6.75, u , radians(-40), radians(-170), false); + ctx.closePath(); + ctx.fill(); + + // right shoe + // tip + ctx.beginPath(); + ctx.arc(w - r, u * 4.5, r, radians(-180), radians(20), false); + ctx.lineTo(w - u, u * 8.5); + ctx.lineTo(w - (r * 2), u * 8); + ctx.closePath(); + ctx.fill(); + // heel + ctx.beginPath(); + ctx.arc(w - (u * 2.25), u * 9, u, radians(0), radians(-150), false); + ctx.closePath(); + ctx.fill(); + return canvas; +};