High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(web): single grid row spacing (#30277)
Jason Rasmussenbc6bf388c017
diff --git a/web/src/lib/components/shared-components/SingleGridRow.svelte b/web/src/lib/components/shared-components/SingleGridRow.svelteindex b71086830c..1d94abfa68 100644--- a/web/src/lib/components/shared-components/SingleGridRow.svelte+++ b/web/src/lib/components/shared-components/SingleGridRow.svelte@@ -10,16 +10,11 @@let container: HTMLElement | undefined = $state();let contentRect: DOMRectReadOnly | undefined = $state();- const getGridGap = (element: Element) => {+ const getColumnGap = (element: Element) => {const style = getComputedStyle(element);-- return {- columnGap: parsePixels(style.columnGap),- };+ return Number.parseInt(style.columnGap) || 0;};- const parsePixels = (style: string) => Math.trunc(Number(style)) || 0;-const getItemCount = (container: HTMLElement, containerWidth: number) => {if (!container.firstElementChild) {return 1;@@ -27,7 +22,7 @@const childContentRect = container.firstElementChild.getBoundingClientRect();const childWidth = Math.floor(childContentRect.width || Infinity);- const { columnGap } = getGridGap(container);+ const columnGap = getColumnGap(container);return Math.floor((containerWidth + columnGap) / (childWidth + columnGap)) || 1;};