Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jokester committed Mar 18, 2024
1 parent 7e8ee90 commit bf64b02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/MitPreprocess/TranslateCompanion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const MAX_FILE_COUNT = 30;
function getQuadCenter(q: TextQuad) {
const x = sumBy(q.pts, (p) => p[0]) / q.pts.length;
const y = sumBy(q.pts, (p) => p[1]) / q.pts.length;
return { x: clamp(x, 0, 1), y: clamp(y, 0, 1) } as const;
return { x, y } as const;
}

async function translateFile(
Expand All @@ -39,8 +39,8 @@ async function translateFile(
.map((q) => {
const { x, y } = getQuadCenter(q);
return {
x: x / size.width,
y: y / size.height,
x: clamp(x / size.width, 0, 1),
y: clamp(y / size.height, 0, 1),
position_type: 1,
translation: `${q.raw_text}\n${q.translated}`,
};
Expand Down

0 comments on commit bf64b02

Please sign in to comment.