MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / applyViewForCurrentFolder

Function applyViewForCurrentFolder

renderer.js:673–685  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

671 const g = horizontalGap;
672 const aw = Math.max(0, availableWidth);
673 const cols = PREVIEW_COLUMNS[currentPreviewTileSize] || PREVIEW_COLUMNS.m;
674 if (cols <= 0) return PREVIEW_TILE_PX.m;
675
676 // Use fixed column count and scale tile so the row fills available width.
677 const computed = Math.floor((aw - (cols - 1) * g) / cols);
678 return Math.max(1, computed);
679}
680
681function getPreviewTileSizePx() {
682 const grid = document.querySelector('.file-grid');
683 if (
684 currentGridView === 'preview' &&
685 grid &&
686 typeof grid._previewTilePx === 'number' &&
687 grid._previewTilePx > 0
688 ) {

Callers

nothing calls this directly

Calls 2

getViewForFolderFunction · 0.85

Tested by

no test coverage detected