Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Collage variable naming #251

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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