Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
froyo-np committed Nov 21, 2024
1 parent 1f3c11e commit f86312f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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"
}
}
}
5 changes: 2 additions & 3 deletions packages/dzi/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,10 @@ export function imageSizeAtLayer(dzi: DziImage, layer: number) {
// solve for N, X = the larger the image dimensions:
// X * (0.5^N) <= maxLayerSize ...
// 0.5^N = maxLayerSize/X ...
// log_0.5(maxLayerSize/X) = N
// log_0.5(maxLayerSize/X) = N
const bigger = Math.max(size[0], size[1]);
const N = Math.ceil(logBaseHalf(layerMaxSize / bigger))
const N = Math.ceil(logBaseHalf(layerMaxSize / bigger));
return Vec2.ceil(Vec2.scale(size, 0.5 ** N));

}
export function tilesInLayer(dzi: DziImage, layer: number): box2D[][] {
const { overlap, tileSize } = dzi;
Expand Down

0 comments on commit f86312f

Please sign in to comment.