kopia lustrzana https://github.com/backface/turtlestitch
tweaked magnifier symbols rendering
rodzic
c31d259129
commit
2bebfcd154
|
@ -50,11 +50,11 @@ WorldMorph.prototype.customMorphs = function () {
|
||||||
// add examples to the world's demo menu
|
// add examples to the world's demo menu
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'line',
|
'magnifyingGlass',
|
||||||
'cross',
|
'magnifierOutline',
|
||||||
'crosshairs',
|
'selection',
|
||||||
'paintbucket',
|
'polygon',
|
||||||
'eraser',
|
'closedBrush'
|
||||||
].map(sym => new SymbolMorph(sym, 50, new Color(250, 250, 250), new Point(-1, -1), new Color(20, 20, 20)));
|
].map(sym => new SymbolMorph(sym, 50, new Color(250, 250, 250), new Point(-1, -1), new Color(20, 20, 20)));
|
||||||
/*
|
/*
|
||||||
[
|
[
|
||||||
|
@ -120,13 +120,11 @@ SymbolMorph.prototype.names = [
|
||||||
'circle',
|
'circle',
|
||||||
'circleSolid',
|
'circleSolid',
|
||||||
'ellipse',
|
'ellipse',
|
||||||
|
|
||||||
'line',
|
'line',
|
||||||
'cross',
|
'cross',
|
||||||
'crosshairs',
|
'crosshairs',
|
||||||
'paintbucket',
|
'paintbucket',
|
||||||
'eraser',
|
'eraser',
|
||||||
|
|
||||||
'pipette',
|
'pipette',
|
||||||
'speechBubble',
|
'speechBubble',
|
||||||
'speechBubbleOutline',
|
'speechBubbleOutline',
|
||||||
|
@ -141,12 +139,14 @@ SymbolMorph.prototype.names = [
|
||||||
'arrowDownOutline',
|
'arrowDownOutline',
|
||||||
'arrowRight',
|
'arrowRight',
|
||||||
'arrowRightOutline',
|
'arrowRightOutline',
|
||||||
|
|
||||||
'robot',
|
'robot',
|
||||||
'magnifyingGlass',
|
'magnifyingGlass',
|
||||||
'magnifierOutline',
|
'magnifierOutline',
|
||||||
'selection',
|
'selection',
|
||||||
'polygon',
|
'polygon',
|
||||||
'closedBrush',
|
'closedBrush',
|
||||||
|
|
||||||
'notes',
|
'notes',
|
||||||
'camera',
|
'camera',
|
||||||
'location',
|
'location',
|
||||||
|
@ -1502,10 +1502,12 @@ SymbolMorph.prototype.renderSymbolMagnifyingGlass = function (ctx, color) {
|
||||||
gradient.addColorStop(0, color.inverted().lighter(50).toString());
|
gradient.addColorStop(0, color.inverted().lighter(50).toString());
|
||||||
gradient.addColorStop(1, color.inverted().darker(25).toString());
|
gradient.addColorStop(1, color.inverted().darker(25).toString());
|
||||||
ctx.fillStyle = gradient;
|
ctx.fillStyle = gradient;
|
||||||
|
ctx.beginPath();
|
||||||
ctx.arc(x, y, r, radians(0), radians(360), false);
|
ctx.arc(x, y, r, radians(0), radians(360), false);
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
|
|
||||||
ctx.lineWidth = l / 2;
|
ctx.lineWidth = l / 2;
|
||||||
|
ctx.beginPath();
|
||||||
ctx.arc(x, y, r, radians(0), radians(360), false);
|
ctx.arc(x, y, r, radians(0), radians(360), false);
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
|
|
||||||
|
@ -1529,6 +1531,7 @@ SymbolMorph.prototype.renderSymbolMagnifierOutline = function (ctx, color) {
|
||||||
ctx.strokeStyle = color.toString();
|
ctx.strokeStyle = color.toString();
|
||||||
|
|
||||||
ctx.lineWidth = l * 0.5;
|
ctx.lineWidth = l * 0.5;
|
||||||
|
ctx.beginPath();
|
||||||
ctx.arc(x, y, r, radians(0), radians(360), false);
|
ctx.arc(x, y, r, radians(0), radians(360), false);
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue