Open JoOkuma opened 2 years ago
@JoOkuma I tried the code snippet in main c95f4b68a57154ddb0b65354a1be9d191dca2014 and I don't get any strange behavior, just the expected (?) print:
world (99.0, 41.0, 21.498198859064274, 39.00870470341276) data [99. 41. 21.49819886 39.0087047 ]
Is this still an issue for you?
🐛 Bug
The
MouseEvent
position doesn't seem to be mapping to the correct position in the canvas when the layers have different scales.I'm reproducing this bug by setting the current step of the viewer to the position where the mouse double click was captured. I expected the viewer to stay at the same step, but it moves, hence
event.position
is not at thecurrent_step
. Is this expected?The layer's
world_to_data
transform also doesn't take this into account, you can see with the print that no transformation is done. My guess is that the scaling of the layers results in a shift (rounding/interpolation) in the data and this is not taken into account.To Reproduce
Steps to reproduce the behavior:
Expected behavior
I didn't expect it to change the plane since I'm setting the step to the position where the click occurred.
Environment
Additional context
It should be noted as well, that the 0-axis displays a length longer than the length of the largest data (100)
This behavior exists for a while, it never bothered me, but now I think it's related to the interpolation of the data after the scaling. So it could be related to the bug.