summary refs log tree commit diff stats
path: root/compiler/scriptconfig.nim
Commit message (Expand)AuthorAgeFilesLines
...
* patchFile: support properlyAndreas Rumpf2016-07-141-3/+5
* nimscript.patchFile supports $lib and stuffAraq2016-07-141-1/+1
* make tests green againAndreas Rumpf2016-07-101-1/+0
* make hint/warning work properly after Nimscript executionAndreas Rumpf2016-07-091-0/+1
* Nimscript: added support for 'patchFile'Andreas Rumpf2016-07-091-1/+7
* Nimscript supports hint() and warning() procs; refs #3688Andreas Rumpf2016-07-081-2/+7
* Nimscript knows about the command line definesAndreas Rumpf2016-05-241-2/+2
* NimScript: --define works as expectedAraq2015-09-301-1/+4
* NimScript: setCommand takes an optional project filenameAraq2015-09-291-0/+7
* Nimscript: documented; 'exec' now produces output immediatelyAraq2015-09-071-1/+4
* split os into os and ospaths parts; ospaths is available for NimScript; bette...Araq2015-09-041-0/+13
* preparations for Nimble NimScript integrations; minor cleanupsAraq2015-08-181-1/+2
* implements experimental new config system based on NimScriptAraq2015-08-161-0/+119
ex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
const Renderer = {
    drawHex(ctx, hex, x, y, size, fillStyle, strokeStyle) {
        ctx.beginPath();
        for (let i = 0; i < 6; i++) {
            const angle = 2 * Math.PI / 6 * i;
            const xPos = x + size * Math.cos(angle);
            const yPos = y + size * Math.sin(angle);
            if (i === 0) ctx.moveTo(xPos, yPos);
            else ctx.lineTo(xPos, yPos);
        }
        ctx.closePath();
        
        if (fillStyle) {
            ctx.fillStyle = fillStyle;
            ctx.fill();
        }
        if (strokeStyle) {
            ctx.strokeStyle = strokeStyle;
            ctx.stroke();
        }
    },
    
    drawCircle(ctx, x, y, radius, fillStyle) {
        ctx.fillStyle = fillStyle;
        ctx.beginPath();
        ctx.arc(x, y, radius, 0, Math.PI * 2);
        ctx.fill();
    }
};