Skip to content

Commit

Permalink
adjust width and auto calc firstGameHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
beam41 committed Nov 14, 2024
1 parent 3712e59 commit 6c8bd5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/draw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ import { Game } from './types';

export async function draw(
game: Game[],
firstGameHeight: number,
otherGameHeight: number,
fullWidth: number,
otherGameHeight: number,
padding: number,
rectRound: number,
): Promise<{ content: string; fullHeight: number }> {
const game0 = game[0];

const firstGameHeight = fullWidth * (215 / 460);

const fullHeight = firstGameHeight + otherGameHeight * (game.length - 1);

const content = $(
Expand Down Expand Up @@ -102,8 +103,8 @@ export async function draw(
drawOther(
v,
firstGameHeight + otherGameHeight * i,
otherGameHeight,
fullWidth,
otherGameHeight,
padding,
rectRound,
),
Expand All @@ -117,8 +118,8 @@ export async function draw(
export async function drawOther(
{ id, name, time2w, timeTotal, imgIco }: Game,
positionY: number,
otherGameHeight: number,
fullWidth: number,
otherGameHeight: number,
padding: number,
rectRound: number,
) {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function main() {
}

console.time('Draw new img file');
const { content, fullHeight } = await draw(stats, 105, 32, 225, 8, 4);
const { content, fullHeight } = await draw(stats, 300, 32, 8, 4);
console.timeEnd('Draw new img file');

console.time('Remove old img file');
Expand Down

0 comments on commit 6c8bd5c

Please sign in to comment.