🚀 tune gif margin
This commit is contained in:
@@ -2,16 +2,11 @@ import * as fs from "fs";
|
|||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import { generateContributionSnake } from "../generateContributionSnake";
|
import { generateContributionSnake } from "../generateContributionSnake";
|
||||||
|
|
||||||
const dir = path.resolve(process.cwd(), "__tests__", "__snapshots__");
|
|
||||||
|
|
||||||
try {
|
|
||||||
fs.mkdirSync(dir);
|
|
||||||
} catch (err) {}
|
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const output = path.join(dir, "out.gif");
|
const output = path.join(process.cwd(), "__tests__/__snapshots__/out.gif");
|
||||||
|
|
||||||
const buffer = await generateContributionSnake("platane");
|
const buffer = await generateContributionSnake("platane");
|
||||||
|
|
||||||
console.log("💾 writing to", dir);
|
console.log("💾 writing to", output);
|
||||||
fs.writeFileSync(output, buffer);
|
fs.writeFileSync(output, buffer);
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export const createGif = async (
|
|||||||
) =>
|
) =>
|
||||||
withTmpDir(async (dir) => {
|
withTmpDir(async (dir) => {
|
||||||
const width = drawOptions.sizeCell * (grid0.width + 2);
|
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 canvas = createCanvas(width, height);
|
||||||
const ctx = canvas.getContext("2d")!;
|
const ctx = canvas.getContext("2d")!;
|
||||||
|
|||||||
Reference in New Issue
Block a user