pickAsync method little bug

Looks like code:

const invertedY = rttSizeH - y - 1;
this._preparePickingBuffer(this._engine!, rttSizeW, rttSizeH, x, invertedY);

return await this._executePicking(x, invertedY, disposeWhenDone);

must be

const invertedY = rttSizeH - adjustedY - 1;
this._preparePickingBuffer(this._engine!, rttSizeW, rttSizeH, adjustedX, invertedY);

return await this._executePicking(adjustedX, invertedY, disposeWhenDone);
2 Likes

nice catch!

1 Like

Fix wrong adjusted coordinates by deltakosh · Pull Request #15568 · BabylonJS/Babylon.js (github.com)

2 Likes

return this._executePicking(x, invertedY, disposeWhenDone);

“adjustedX” must be instead of “x”. Seems like you forgot it.

1 Like

Will do!

It was my mistake, not @Deltakosh’s :see_no_evil:

1 Like