Skip to content

Commit 3e422aa

Browse files
authored
Allow to pass event code and touches to EventTouch constructor. (#2890)
1 parent 1bb1daf commit 3e422aa

File tree

3 files changed

+1944
-2003
lines changed

3 files changed

+1944
-2003
lines changed

core/base/EventTouch.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include "base/EventTouch.h"
2727
#include "base/Touch.h"
2828

29+
#include <utility>
30+
2931
namespace ax
3032
{
3133

@@ -34,4 +36,8 @@ EventTouch::EventTouch() : Event(Type::TOUCH)
3436
_touches.reserve(MAX_TOUCHES);
3537
}
3638

37-
}
39+
EventTouch::EventTouch(EventCode eventCode, std::vector<Touch*> touches)
40+
: Event(Type::TOUCH), _eventCode(eventCode), _touches(std::move(touches))
41+
{}
42+
43+
} // namespace ax

core/base/EventTouch.h

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ namespace ax
3838

3939
class Touch;
4040

41-
#define TOUCH_PERF_DEBUG 1
42-
4341
/** @class EventTouch
4442
* @brief Touch event.
4543
*/
@@ -61,6 +59,7 @@ class AX_DLL EventTouch : public Event
6159
* Constructor.
6260
*/
6361
EventTouch();
62+
EventTouch(EventCode eventCode, std::vector<Touch*> touches);
6463

6564
/** Get event code.
6665
*
@@ -74,27 +73,14 @@ class AX_DLL EventTouch : public Event
7473
*/
7574
const std::vector<Touch*>& getTouches() const { return _touches; }
7675

77-
#if TOUCH_PERF_DEBUG
78-
/** Set the event code.
79-
*
80-
* @param eventCode A given EventCode.
81-
*/
82-
void setEventCode(EventCode eventCode) { _eventCode = eventCode; };
83-
/** Set the touches
84-
*
85-
* @param touches A given touches vector.
86-
*/
87-
void setTouches(const std::vector<Touch*>& touches) { _touches = touches; };
88-
#endif
89-
9076
private:
9177
EventCode _eventCode;
9278
std::vector<Touch*> _touches;
9379

9480
friend class RenderView;
9581
};
9682

97-
}
83+
} // namespace ax
9884

9985
// end of base group
10086
/// @}

0 commit comments

Comments
 (0)