1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00

Resolved a Windows/Android touchID incompatibility

This commit is contained in:
Tom Poole 2019-06-06 17:22:13 +01:00
parent 670f77f80c
commit 061ea2e072

View file

@ -24,6 +24,13 @@
==============================================================================
*/
#if JUCE_CLANG
#if __has_warning("-Wzero-as-null-pointer-constant")
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#endif
namespace juce
{
@ -35,7 +42,7 @@ public:
int getIndexOfTouch (ComponentPeer* peer, IDType touchID)
{
jassert (touchID != nullptr); // need to rethink this if IDs can be 0!
jassert (touchID != 0); // need to rethink this if IDs can be 0!
TouchInfo info {touchID, peer};
int touchIndex = currentTouches.indexOf (info);
@ -64,7 +71,7 @@ public:
bool areAnyTouchesActive() const noexcept
{
for (auto& t : currentTouches)
if (t.touchId != nullptr)
if (t.touchId != 0)
return true;
return false;
@ -72,16 +79,16 @@ public:
void deleteAllTouchesForPeer (ComponentPeer* peer)
{
for (auto& t : currentTouches)
if (t.owner == peer)
t.touchId = nullptr;
for (auto& t : currentTouches)
if (t.owner == peer)
t.touchId = 0;
}
private:
//==============================================================================
struct TouchInfo
{
TouchInfo() noexcept : touchId (nullptr), owner (nullptr) {}
TouchInfo() noexcept : touchId (0), owner (nullptr) {}
TouchInfo (IDType idToUse, ComponentPeer* peer) noexcept : touchId (idToUse), owner (peer) {}
TouchInfo (const TouchInfo&) = default;
@ -112,3 +119,9 @@ private:
};
} // namespace juce
#if JUCE_CLANG
#if __has_warning("-Wzero-as-null-pointer-constant")
#pragma clang diagnostic pop
#endif
#endif