Fix hitdetection of icons with opacity < 1
Hit detection works by reading the pixel color, if the icon is not drawn with full opacity it won't work.
This commit is contained in:
@@ -81,7 +81,7 @@ export function createHitDetectionImageData(
|
|||||||
}
|
}
|
||||||
style.setText(undefined);
|
style.setText(undefined);
|
||||||
const image = originalStyle.getImage();
|
const image = originalStyle.getImage();
|
||||||
if (image) {
|
if (image && image.getOpacity() !== 0) {
|
||||||
const imgSize = image.getImageSize();
|
const imgSize = image.getImageSize();
|
||||||
if (!imgSize) {
|
if (!imgSize) {
|
||||||
continue;
|
continue;
|
||||||
@@ -106,8 +106,8 @@ export function createHitDetectionImageData(
|
|||||||
anchorXUnits: IconAnchorUnits.PIXELS,
|
anchorXUnits: IconAnchorUnits.PIXELS,
|
||||||
anchorYUnits: IconAnchorUnits.PIXELS,
|
anchorYUnits: IconAnchorUnits.PIXELS,
|
||||||
offset: image.getOrigin(),
|
offset: image.getOrigin(),
|
||||||
|
opacity: 1,
|
||||||
size: image.getSize(),
|
size: image.getSize(),
|
||||||
opacity: image.getOpacity(),
|
|
||||||
scale: image.getScale(),
|
scale: image.getScale(),
|
||||||
rotation: image.getRotation(),
|
rotation: image.getRotation(),
|
||||||
rotateWithView: image.getRotateWithView(),
|
rotateWithView: image.getRotateWithView(),
|
||||||
|
|||||||
Reference in New Issue
Block a user