parent
f5bd6003a8
commit
0f74fb8255
|
@ -45,6 +45,8 @@ namespace Coffee.UIExtensions
|
|||
new Color(1, 1, 1, 0),
|
||||
};
|
||||
|
||||
static bool s_UVStartsAtTop;
|
||||
|
||||
|
||||
//################################
|
||||
// Serialize Members.
|
||||
|
@ -259,7 +261,9 @@ 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 = s_UVStartsAtTop
|
||||
? (int)((softMaskBuffer.height - 1) * Mathf.Clamp01(sp.y / Screen.height))
|
||||
: (int)((softMaskBuffer.height - 1) * (1 - Mathf.Clamp01(sp.y / Screen.height)));
|
||||
return 0.5f < GetPixelValue(x, y, interactions);
|
||||
}
|
||||
|
||||
|
@ -282,6 +286,7 @@ namespace Coffee.UIExtensions
|
|||
// Register.
|
||||
if (s_ActiveSoftMasks.Count == 0)
|
||||
{
|
||||
s_UVStartsAtTop = SystemInfo.graphicsUVStartsAtTop;
|
||||
Canvas.willRenderCanvases += UpdateMaskTextures;
|
||||
|
||||
if (s_StencilCompId == 0)
|
||||
|
|
Loading…
Reference in New Issue