Fix getFeatures after rotation reset for VectorImage

This commit is contained in:
Andreas Hocevar
2020-06-24 21:37:25 +02:00
parent ac14f6df62
commit 18a8961d79
+8 -9
View File
@@ -150,20 +150,11 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
function () { function () {
if (image.getState() === ImageState.LOADED) { if (image.getState() === ImageState.LOADED) {
this.image_ = image; this.image_ = image;
}
}.bind(this)
);
image.load();
}
if (this.image_) {
const image = this.image_;
const imageResolution = image.getResolution(); const imageResolution = image.getResolution();
const imagePixelRatio = image.getPixelRatio(); const imagePixelRatio = image.getPixelRatio();
const renderedResolution = const renderedResolution =
(imageResolution * pixelRatio) / imagePixelRatio; (imageResolution * pixelRatio) / imagePixelRatio;
this.renderedResolution = renderedResolution; this.renderedResolution = renderedResolution;
this.renderedPixelToCoordinateTransform_ = frameState.pixelToCoordinateTransform.slice();
this.coordinateToVectorPixelTransform_ = compose( this.coordinateToVectorPixelTransform_ = compose(
this.coordinateToVectorPixelTransform_, this.coordinateToVectorPixelTransform_,
width / 2, width / 2,
@@ -175,6 +166,14 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
-viewState.center[1] -viewState.center[1]
); );
} }
}.bind(this)
);
image.load();
}
if (this.image_) {
this.renderedPixelToCoordinateTransform_ = frameState.pixelToCoordinateTransform.slice();
}
return !!this.image_; return !!this.image_;
} }