Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Dec 3, 2024
1 parent 9f6768c commit f4bca45
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions pages/gallery/gallery-grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,16 @@ export default {
const width = this.$el.clientWidth - MARGIN * 2;
if (baseColumns != 1) {
// * We want to solve n * MIN_WIDTH + (n - 1) * A = width
// * where A = 200 / (1.5 * n)
// * => n * MIN_WIDTH + ((n*200)/(1.5*n)) - 1*200/(1.5*n) = width
// * => n * MIN_WIDTH + 200/1.5 - 200/(1.5*n) = width
// * multiply by n
// * => n² * MIN_WIDTH + 200n/1.5 - 200/1.5 = width*n
// * => n² * MIN_WITH + n * (200/1.5 - width) - 200/1.5 = 0
// * solve that and keep positive value
/**
* We want to solve n * MIN_WIDTH + (n - 1) * A = width
* where A = 200 / (1.5 * n)
* => n * MIN_WIDTH + ((n*200)/(1.5*n)) - 1*200/(1.5*n) = width
* => n * MIN_WIDTH + 200/1.5 - 200/(1.5*n) = width
* multiply by n
* => n² * MIN_WIDTH + 200n/1.5 - 200/1.5 = width*n
* => n² * MIN_WITH + n * (200/1.5 - width) - 200/1.5 = 0
* solve that and keep positive value
*/
const a = MIN_WIDTH;
const b = 200 / 1.5 - width;
const c = -200 / 1.5;
Expand Down Expand Up @@ -226,7 +228,7 @@ export default {
},
watch: {
pack(n, o) {
if (n === o || !Object.keys(this.loadedContributions),length) return;
if (n === o || !Object.keys(this.loadedContributions).length) return;
this.lastContributions = this.getLastContributions(n);
},
value(newValue) {
Expand Down

0 comments on commit f4bca45

Please sign in to comment.