fix(viewer.js): Avoid rounding zoom factors that are too close to avoid duplicated resolution errors #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Address Error caused by rounding the zoom factor:: ImagingDataCommons/slim#175
(level 0)
baseTotalPixelMatrixColumns / totalPixelMatrixColumns = 30920 / 30920 = 1
(level 1)
baseTotalPixelMatrixColumns / totalPixelMatrixColumns = 30920 / 1932 = 16.00414078674948 (16)
(level 2)
baseTotalPixelMatrixColumns / totalPixelMatrixColumns = 30920 / 1920 = 16.104166666666668 (16)
This way the resolutions array will be [16, 16, 1], and although its descending OpenLayers assertion doesn't allow equivalent numbers, the resolutions array should be composed of unique resolutions in descending order.
Removing the rounding here:
dicom-microscopy-viewer/src/pyramid.js
Line 211 in bda0cfe
Results: