mirror of https://gitee.com/antv-l7/antv-l7
fix(interaction): 高分屏拾取问题
This commit is contained in:
parent
a5e6da8144
commit
4439310957
|
@ -48,10 +48,12 @@ export default class PickingService implements IPickingService {
|
|||
getViewportSize,
|
||||
getContainer,
|
||||
} = this.rendererService;
|
||||
const {
|
||||
let {
|
||||
width,
|
||||
height,
|
||||
} = (getContainer() as HTMLElement).getBoundingClientRect();
|
||||
width *= window.devicePixelRatio;
|
||||
height *= window.devicePixelRatio;
|
||||
this.pickBufferScale =
|
||||
this.configService.getSceneConfig(id).pickBufferScale || 1;
|
||||
// 创建 picking framebuffer,后续实时 resize
|
||||
|
@ -86,10 +88,12 @@ export default class PickingService implements IPickingService {
|
|||
clear,
|
||||
getContainer,
|
||||
} = this.rendererService;
|
||||
const {
|
||||
let {
|
||||
width,
|
||||
height,
|
||||
} = (getContainer() as HTMLElement).getBoundingClientRect();
|
||||
width *= window.devicePixelRatio;
|
||||
height *= window.devicePixelRatio;
|
||||
if (this.width !== width || this.height !== height) {
|
||||
this.pickingFBO.resize({
|
||||
width: Math.round(width / this.pickBufferScale),
|
||||
|
@ -125,10 +129,12 @@ export default class PickingService implements IPickingService {
|
|||
) => {
|
||||
let isPicked = false;
|
||||
const { getViewportSize, readPixels, getContainer } = this.rendererService;
|
||||
const {
|
||||
let {
|
||||
width,
|
||||
height,
|
||||
} = (getContainer() as HTMLElement).getBoundingClientRect();
|
||||
width *= window.devicePixelRatio;
|
||||
height *= window.devicePixelRatio;
|
||||
const { enableHighlight, enableSelect } = layer.getLayerConfig();
|
||||
|
||||
const xInDevicePixel = x * window.devicePixelRatio;
|
||||
|
|
Loading…
Reference in New Issue