fixed #52 where click events were not detected due to the y axis beeing inverted on some graphics apis
parent
ec9712039c
commit
8588724900
|
@ -259,7 +259,16 @@ namespace Coffee.UIExtensions
|
|||
}
|
||||
|
||||
int x = (int)((softMaskBuffer.width - 1) * Mathf.Clamp01(sp.x / Screen.width));
|
||||
int y = (int)((softMaskBuffer.height - 1) * Mathf.Clamp01(sp.y / Screen.height));
|
||||
int y = (int)((softMaskBuffer.height - 1) * (Mathf.Clamp01(sp.y / Screen.height)));
|
||||
|
||||
if ((SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11) ||
|
||||
(SystemInfo.graphicsDeviceType == GraphicsDeviceType.PlayStation4) ||
|
||||
(SystemInfo.graphicsDeviceType == GraphicsDeviceType.Vulkan) ||
|
||||
(SystemInfo.graphicsDeviceType == GraphicsDeviceType.Switch))
|
||||
{
|
||||
y = (int)((softMaskBuffer.height - 1) * (1 - Mathf.Clamp01(sp.y / Screen.height)));
|
||||
}
|
||||
|
||||
return 0.5f < GetPixelValue(x, y, interactions);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue