Fix getFeatures after rotation reset for VectorImage
This commit is contained in:
@@ -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_;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user