kopia lustrzana https://github.com/backface/turtlestitch
migrated cloudGradient symbol
rodzic
d04700b066
commit
4875469988
|
@ -51,7 +51,7 @@ WorldMorph.prototype.customMorphs = function () {
|
|||
|
||||
return [
|
||||
new SymbolMorph(
|
||||
'cloud',
|
||||
'cloudGradient',
|
||||
50,
|
||||
new Color(250, 250, 250),
|
||||
new Point(-1, -1),
|
||||
|
@ -98,9 +98,9 @@ SymbolMorph.prototype.names = [
|
|||
'flag',
|
||||
'octagon',
|
||||
'cloud',
|
||||
'cloudGradient',
|
||||
|
||||
'cloudOutline',
|
||||
'cloudGradient',
|
||||
'turnRight',
|
||||
'turnLeft',
|
||||
'storage',
|
||||
|
@ -261,10 +261,11 @@ SymbolMorph.prototype.renderShape = function (ctx, aColor) {
|
|||
case 'cloud':
|
||||
this.renderSymbolCloud(ctx, aColor);
|
||||
break;
|
||||
case 'cloudGradient':
|
||||
this.renderSymbolCloudGradient(ctx, aColor);
|
||||
break;
|
||||
case 'cloudOutline':
|
||||
return this.drawSymbolCloudOutline(canvas, aColor);
|
||||
case 'cloudGradient':
|
||||
return this.drawSymbolCloudGradient(canvas, aColor);
|
||||
case 'turnRight':
|
||||
return this.drawSymbolTurnRight(canvas, aColor);
|
||||
case 'turnLeft':
|
||||
|
@ -676,7 +677,7 @@ SymbolMorph.prototype.renderSymbolOctagon = function (ctx, color) {
|
|||
};
|
||||
|
||||
SymbolMorph.prototype.renderSymbolCloud = function (ctx, color) {
|
||||
// answer a canvas showing an cloud
|
||||
// draw a cloud
|
||||
var w = this.symbolWidth(),
|
||||
h = this.size,
|
||||
r1 = h * 2 / 5,
|
||||
|
@ -694,12 +695,11 @@ SymbolMorph.prototype.renderSymbolCloud = function (ctx, color) {
|
|||
ctx.fill();
|
||||
};
|
||||
|
||||
SymbolMorph.prototype.drawSymbolCloudGradient = function (canvas, color) {
|
||||
// answer a canvas showing an cloud
|
||||
var ctx = canvas.getContext('2d'),
|
||||
SymbolMorph.prototype.renderSymbolCloudGradient = function (ctx, color) {
|
||||
// draw a cloud
|
||||
var w = this.symbolWidth(),
|
||||
h = this.size,
|
||||
gradient,
|
||||
w = canvas.width,
|
||||
h = canvas.height,
|
||||
r1 = h * 2 / 5,
|
||||
r2 = h / 4,
|
||||
r3 = h * 3 / 10,
|
||||
|
@ -723,8 +723,6 @@ SymbolMorph.prototype.drawSymbolCloudGradient = function (canvas, color) {
|
|||
ctx.arc(w - r3, h - r3, r3, radians(269), radians(90), false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
|
||||
return canvas;
|
||||
};
|
||||
|
||||
SymbolMorph.prototype.drawSymbolCloudOutline = function (canvas, color) {
|
||||
|
|
Ładowanie…
Reference in New Issue