🚀 tune gif margin

This commit is contained in:
platane
2020-10-15 01:51:37 +02:00
parent 99ae4e3863
commit 42083b4250
2 changed files with 4 additions and 9 deletions

View File

@@ -2,16 +2,11 @@ import * as fs from "fs";
import * as path from "path";
import { generateContributionSnake } from "../generateContributionSnake";
const dir = path.resolve(process.cwd(), "__tests__", "__snapshots__");
try {
fs.mkdirSync(dir);
} catch (err) {}
(async () => {
const output = path.join(dir, "out.gif");
const output = path.join(process.cwd(), "__tests__/__snapshots__/out.gif");
const buffer = await generateContributionSnake("platane");
console.log("💾 writing to", dir);
console.log("💾 writing to", output);
fs.writeFileSync(output, buffer);
})();

View File

@@ -30,7 +30,7 @@ export const createGif = async (
) =>
withTmpDir(async (dir) => {
const width = drawOptions.sizeCell * (grid0.width + 2);
const height = drawOptions.sizeCell * (grid0.height + 4) + 100;
const height = drawOptions.sizeCell * (grid0.height + 4) + 30;
const canvas = createCanvas(width, height);
const ctx = canvas.getContext("2d")!;