mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Fix picking pixel on integer indices
The QImage.pixel() function should only get integers. In theory an input position of -2,-2 would get rounded to 0 now. However that shouldn't occur because the user can't click outside of the window. And if it does occur, it's not really a problem either that it's theoretically picking a position inside of the window when you click slightly next to it. Fixes #10785.
This commit is contained in:
parent
3466404782
commit
e0e227404f
@ -72,8 +72,8 @@ class PickingPass(RenderPass):
|
||||
|
||||
window_size = self._renderer.getWindowSize()
|
||||
|
||||
px = (0.5 + x / 2.0) * window_size[0]
|
||||
py = (0.5 + y / 2.0) * window_size[1]
|
||||
px = int((0.5 + x / 2.0) * window_size[0])
|
||||
py = int((0.5 + y / 2.0) * window_size[1])
|
||||
|
||||
if px < 0 or px > (output.width() - 1) or py < 0 or py > (output.height() - 1):
|
||||
return -1
|
||||
|
Loading…
x
Reference in New Issue
Block a user