~smitop/eigen.fun

f893969cb20c004662b0709de5b6fd8810ae6940 — Smitty 3 years ago b860834
Make minor lines smaller
1 files changed, 6 insertions(+), 6 deletions(-)

M public/script.js
M public/script.js => public/script.js +6 -6
@@ 132,7 132,7 @@ function renderPoint(renderOpts, point) {
    ctx.fill();
}

function renderLine(renderOpts, color, arrow, from, to, curCtx = ctx, transform = transformPoint) {
function renderLine(renderOpts, color, arrow, from, to, curCtx = ctx, transform = transformPoint, scaleFactor = 1) {
    const fromT = pointToCanvasCoords(renderOpts, transform(from));
    const toT = pointToCanvasCoords(renderOpts, transform(to));



@@ 140,7 140,7 @@ function renderLine(renderOpts, color, arrow, from, to, curCtx = ctx, transform 
    curCtx.fillStyle = color;

    // line
    const lineWidth = LINE_WIDTH * state.scale;
    const lineWidth = LINE_WIDTH * scaleFactor * state.scale;
    curCtx.beginPath();
    curCtx.moveTo(fromT[0], fromT[1]);
    curCtx.lineTo(toT[0], toT[1]);


@@ 192,7 192,7 @@ function renderGrid(renderOpts, curCtx, transform = transformPoint) {
                renderOpts, themeColor("gridMinor"), false,
                [i + 0.5, -screenBottom],
                [i + 0.5, screenBottom],
                curCtx, transform
                curCtx, transform, 0.5
            );
        }
        if (i !== 0) {


@@ 208,7 208,7 @@ function renderGrid(renderOpts, curCtx, transform = transformPoint) {
                renderOpts, themeColor("gridMinor"), false,
                [-i - 0.5, -screenBottom],
                [-i - 0.5, screenBottom],
                curCtx, transform
                curCtx, transform, 0.5
            );
        }
    }


@@ 225,7 225,7 @@ function renderGrid(renderOpts, curCtx, transform = transformPoint) {
                renderOpts, themeColor("gridMinor"), false,
                [-screenRight, i + 0.5],
                [screenRight, i + 0.5],
                curCtx, transform
                curCtx, transform, 0.5
            );
        }
        if (i !== 0) {


@@ 241,7 241,7 @@ function renderGrid(renderOpts, curCtx, transform = transformPoint) {
                renderOpts, themeColor("gridMinor"), false,
                [-screenRight, -i - 0.5],
                [screenRight, -i - 0.5],
                curCtx, transform
                curCtx, transform, 0.5
            );
        }
    }