Merge pull request #1779 from jstaab/master

apply pixelDensityRatio after flip
This commit is contained in:
Ian Gilman 2020-02-24 15:06:40 -08:00 committed by GitHub
commit 4a6226361f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1929,14 +1929,15 @@ function drawTiles( tiledImage, lastDrawn ) {
// sketch canvas we are going to use for performance reasons. // sketch canvas we are going to use for performance reasons.
bounds = tiledImage.viewport.viewportToViewerElementRectangle( bounds = tiledImage.viewport.viewportToViewerElementRectangle(
tiledImage.getClippedBounds(true)) tiledImage.getClippedBounds(true))
.getIntegerBoundingBox() .getIntegerBoundingBox();
.times($.pixelDensityRatio);
if(tiledImage._drawer.viewer.viewport.getFlip()) { if(tiledImage._drawer.viewer.viewport.getFlip()) {
if (tiledImage.viewport.degrees !== 0 || tiledImage.getRotation(true) % 360 !== 0){ if (tiledImage.viewport.degrees !== 0 || tiledImage.getRotation(true) % 360 !== 0){
bounds.x = tiledImage._drawer.viewer.container.clientWidth - (bounds.x + bounds.width); bounds.x = tiledImage._drawer.viewer.container.clientWidth - (bounds.x + bounds.width);
} }
} }
bounds = bounds.times($.pixelDensityRatio);
} }
tiledImage._drawer._clear(true, bounds); tiledImage._drawer._clear(true, bounds);
} }