|
|
@@ -67,7 +67,7 @@
|
|
|
|
|
|
#include "../DebugNew.h"
|
|
|
|
|
|
-#define TOUCHID_MASK(id) MouseButton(1u << (unsigned)(id))
|
|
|
+#define TOUCHID_MASK(id) MouseButton(1u << static_cast<MouseButtonFlags::Integer>(id))
|
|
|
|
|
|
namespace Urho3D
|
|
|
{
|
|
|
@@ -1839,7 +1839,7 @@ void UI::HandleTouchEnd(StringHash eventType, VariantMap& eventData)
|
|
|
pos.y_ = int(pos.y_ / uiScale_);
|
|
|
|
|
|
// Get the touch index
|
|
|
- auto touchId = TOUCHID_MASK(eventData[P_TOUCHID].GetInt());
|
|
|
+ const MouseButton touchId = TOUCHID_MASK(eventData[P_TOUCHID].GetInt());
|
|
|
|
|
|
// Transmit hover end to the position where the finger was lifted
|
|
|
WeakPtr<UIElement> element(GetElementAt(pos));
|
|
|
@@ -1847,8 +1847,8 @@ void UI::HandleTouchEnd(StringHash eventType, VariantMap& eventData)
|
|
|
// Clear any drag events that were using the touch id
|
|
|
for (auto i = touchDragElements_.Begin(); i != touchDragElements_.End();)
|
|
|
{
|
|
|
- auto touches = i->second_;
|
|
|
- if (touches.Test(touchId))
|
|
|
+ const MouseButtonFlags touches = i->second_;
|
|
|
+ if (touches & touchId)
|
|
|
i = touchDragElements_.Erase(i);
|
|
|
else
|
|
|
++i;
|
|
|
@@ -2069,7 +2069,8 @@ IntVector2 UI::SumTouchPositions(UI::DragData* dragData, const IntVector2& oldSe
|
|
|
auto* input = GetSubsystem<Input>();
|
|
|
for (unsigned i = 0; (1u << i) <= (unsigned)buttons; i++)
|
|
|
{
|
|
|
- if (buttons.Test(MouseButton(1u << i)))
|
|
|
+ auto mouseButton = static_cast<MouseButton>(1u << i);
|
|
|
+ if (buttons & mouseButton)
|
|
|
{
|
|
|
TouchState* ts = input->GetTouch((unsigned)i);
|
|
|
if (!ts)
|