Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lanesawyer committed Oct 31, 2024
1 parent 28796a0 commit 2394856
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2024 Allen Institute
Copyright 2024 Allen Institute

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Expand All @@ -8,4 +8,4 @@ Redistribution and use in source and binary forms, with or without modification,

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@
"regl": "^2.1.0",
"zarrita": "0.4.0-next.14"
}
}
}
2 changes: 1 addition & 1 deletion packages/dzi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@
"lodash": "^4.17.21",
"regl": "^2.1.0"
}
}
}
16 changes: 8 additions & 8 deletions packages/dzi/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ export function getVisibleTiles(dzi: DziImage, camera: { view: box2D; screenSize

const availableTiles = tilesInLayer(dzi, layer);
const baseLayer = findLargestSingleTileLayer(dzi);
const baseIndex: TileIndex = { col: 0, row: 0 }
const baseIndex: TileIndex = { col: 0, row: 0 };
const baseTile: DziTile = {
index: baseIndex,
layer: baseLayer,
relativeLocation: Box2D.create([0, 0], [1, 1]),
url: tileUrl(dzi, baseLayer, baseIndex)
}
url: tileUrl(dzi, baseLayer, baseIndex),
};

// note that the tile boxes are in pixels relative to the layer in which they reside
// the given view is assumed to be a parameter (in the space [0:1]) of the image as a whole
Expand All @@ -82,7 +82,7 @@ export function getVisibleTiles(dzi: DziImage, camera: { view: box2D; screenSize
// filter out tiles which are not in view
})
.filter((t) => !!Box2D.intersection(t.relativeLocation, camera.view));
return (baseLayer < layer) ? [baseTile, ...tiles] : tiles;
return baseLayer < layer ? [baseTile, ...tiles] : tiles;
}
/**
* NOTE: THE REMAINDER OF THIS FILE IS EXPORTED ONLY FOR TESTING PURPOSES
Expand All @@ -97,13 +97,13 @@ export function firstSuitableLayer(imageWidth: number, screenWidth: number) {
}

/**
*
* @param dzi
*
* @param dzi
* @returns the index of the largest layer which contains only a single tile
*
*
*/
function findLargestSingleTileLayer(dzi: DziImage): number {
return Math.floor(Math.log2(dzi.tileSize))
return Math.floor(Math.log2(dzi.tileSize));
}
export function tileWithOverlap(total: number, step: number, overlap: number): Interval[] {
const blocks: Interval[] = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/dzi/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function buildDziRenderer(regl: REGL.Regl): Renderer<DziImage, DziTile, R
};
};
return {
destroy: () => { }, // no private resources to destroy
destroy: () => {}, // no private resources to destroy
cacheKey: (item, _requestKey, _data, _settings) => `${item.url}`,
fetchItemContent: fetchDziTile,
getVisibleItems: (dzi, settings) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/geometry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
"typescript": "^5.3.3",
"vitest": "^1.4.0"
}
}
}

0 comments on commit 2394856

Please sign in to comment.