Skip to content

Commit

Permalink
fix: Collage variable naming (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhea-so committed May 3, 2024
2 parents e45138c + d6ad428 commit 32f9813
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.4.76",
"version": "0.4.77",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
8 changes: 4 additions & 4 deletions web/src/pages/lab/collage/theme/SIMPLE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const SIMPLE_FUNC = (
context.fillStyle = '#ffffff';
context.fillRect(0, 0, canvas.width, canvas.height);

const width = (canvas.width - paddingLeft - paddingRight - marginEach * (numberOfRow - 1)) / numberOfRow;
const height = (canvas.height - paddingTop - paddingBottom - marginEach * (numberOfColumn - 1)) / numberOfColumn;
const width = (canvas.width - paddingLeft - paddingRight - marginEach * (numberOfColumn - 1)) / numberOfColumn;
const height = (canvas.height - paddingTop - paddingBottom - marginEach * (numberOfRow - 1)) / numberOfRow;

const size = numberOfRow * numberOfColumn;
const length = Math.min(photos.length, size);
Expand All @@ -44,8 +44,8 @@ const SIMPLE_FUNC = (
const photo = photos[i];
if (!photo) break;
const image = photo.image;
const x = paddingLeft + (i % numberOfRow) * (width + marginEach);
const y = paddingTop + Math.floor(i / numberOfRow) * (height + marginEach);
const x = paddingLeft + (i % numberOfColumn) * (width + marginEach);
const y = paddingTop + Math.floor(i / numberOfColumn) * (height + marginEach);
const imageWidth = image.width;
const imageHeight = image.height;
const ratio = imageWidth / imageHeight;
Expand Down

0 comments on commit 32f9813

Please sign in to comment.