|
@@ -1,117 +0,0 @@
|
|
|
-diff -r b08c7c8fbf4b oxygine/src/Actor.cpp
|
|
|
|
|
---- a/oxygine/src/Actor.cpp Thu Apr 11 19:02:02 2013 +0600
|
|
|
|
|
-+++ b/oxygine/src/Actor.cpp Thu Apr 11 19:20:22 2013 +0600
|
|
|
|
|
-@@ -247,6 +247,8 @@
|
|
|
|
|
- switch(event->type)
|
|
|
|
|
- {
|
|
|
|
|
- case TouchEvent::TOUCH_DOWN:
|
|
|
|
|
-+ setPressed(me->index);
|
|
|
|
|
-+ /*
|
|
|
|
|
- if (isDescendant(act))
|
|
|
|
|
- {
|
|
|
|
|
- if (event->phase == Event::phase_target)
|
|
|
|
|
-@@ -255,6 +257,11 @@
|
|
|
|
|
- //_pressed = me->id;
|
|
|
|
|
- //setPressed(true);
|
|
|
|
|
- }
|
|
|
|
|
-+ else
|
|
|
|
|
-+ {
|
|
|
|
|
-+ int q=0;
|
|
|
|
|
-+ }
|
|
|
|
|
-+ */
|
|
|
|
|
- break;
|
|
|
|
|
- case TouchEvent::TOUCH_UP:
|
|
|
|
|
- {
|
|
|
|
|
-@@ -264,15 +271,18 @@
|
|
|
|
|
- {
|
|
|
|
|
- setPressed(0);
|
|
|
|
|
- //it is event from ROOT, convert to local space
|
|
|
|
|
-- Vector2 lp = convert_global2local(this, RootActor::instance, me->localPosition);
|
|
|
|
|
-- if (isDescendant(act))
|
|
|
|
|
-+
|
|
|
|
|
-+ //if (isDescendant(act))
|
|
|
|
|
-+ if (me->currentTarget != RootActor::instance)
|
|
|
|
|
- {
|
|
|
|
|
-+ Vector2 lp = convert_global2local(this, RootActor::instance, me->localPosition);
|
|
|
|
|
- TouchEvent e(TouchEvent::CLICK, true, lp);
|
|
|
|
|
- e.index = me->index;
|
|
|
|
|
- dispatchEvent(&e);
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
-+ //it is event from Root outside of this actor
|
|
|
|
|
- dispatchEvent(event);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-@@ -383,8 +393,8 @@
|
|
|
|
|
- event->target = this;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-- if (event->type == TouchEvent::TOUCH_DOWN || event->type == TouchEvent::MOVE)
|
|
|
|
|
-- _onMouseEvent(event);
|
|
|
|
|
-+ //if (event->type == TouchEvent::TOUCH_DOWN || event->type == TouchEvent::MOVE)
|
|
|
|
|
-+ _onMouseEvent(event);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- dispatchEvent(event);
|
|
|
|
|
-diff -r b08c7c8fbf4b oxygine/src/Draggable.cpp
|
|
|
|
|
---- a/oxygine/src/Draggable.cpp Thu Apr 11 19:02:02 2013 +0600
|
|
|
|
|
-+++ b/oxygine/src/Draggable.cpp Thu Apr 11 19:20:22 2013 +0600
|
|
|
|
|
-@@ -111,6 +111,7 @@
|
|
|
|
|
- case TouchEvent::TOUCH_UP:
|
|
|
|
|
- {
|
|
|
|
|
- _pressed = false;
|
|
|
|
|
-+ event->stopPropagation();
|
|
|
|
|
- RootActor::instance->removeEventListeners(this);
|
|
|
|
|
- }
|
|
|
|
|
- break;
|
|
|
|
|
-diff -r b08c7c8fbf4b oxygine/src/SlidingActor.cpp
|
|
|
|
|
---- a/oxygine/src/SlidingActor.cpp Thu Apr 11 19:02:02 2013 +0600
|
|
|
|
|
-+++ b/oxygine/src/SlidingActor.cpp Thu Apr 11 19:20:22 2013 +0600
|
|
|
|
|
-@@ -14,14 +14,14 @@
|
|
|
|
|
- _clip = initActor(new ClipRectActor,
|
|
|
|
|
- arg_attachTo = this);
|
|
|
|
|
-
|
|
|
|
|
-- _clip->addEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &SlidingActor::_newEvent));
|
|
|
|
|
-- _clip->addEventListener(TouchEvent::TOUCH_UP, CLOSURE(this, &SlidingActor::_newEvent));
|
|
|
|
|
-- _clip->addEventListener(TouchEvent::MOVE, CLOSURE(this, &SlidingActor::_newEvent));
|
|
|
|
|
-+
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- void SlidingActor::destroy()
|
|
|
|
|
- {
|
|
|
|
|
- _clip->removeChildren();
|
|
|
|
|
-+ if (_content)
|
|
|
|
|
-+ _content->removeEventListeners(this);
|
|
|
|
|
-
|
|
|
|
|
- _drag.destroy();
|
|
|
|
|
- _content = 0;
|
|
|
|
|
-@@ -69,6 +69,10 @@
|
|
|
|
|
-
|
|
|
|
|
- _clip->addChild(_content);
|
|
|
|
|
-
|
|
|
|
|
-+ _content->addEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &SlidingActor::_newEvent));
|
|
|
|
|
-+ _content->addEventListener(TouchEvent::TOUCH_UP, CLOSURE(this, &SlidingActor::_newEvent));
|
|
|
|
|
-+ _content->addEventListener(TouchEvent::MOVE, CLOSURE(this, &SlidingActor::_newEvent));
|
|
|
|
|
-+
|
|
|
|
|
- updateDragBounds();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-@@ -198,7 +202,7 @@
|
|
|
|
|
- {
|
|
|
|
|
- case TouchEvent::TOUCH_DOWN:
|
|
|
|
|
- _holded = event->target;
|
|
|
|
|
-- _downPos = te->localPosition;
|
|
|
|
|
-+ _downPos = _content->local2global(te->localPosition);
|
|
|
|
|
- _down = true;
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
-@@ -213,7 +217,7 @@
|
|
|
|
|
-
|
|
|
|
|
- case TouchEvent::MOVE:
|
|
|
|
|
- {
|
|
|
|
|
-- Vector2 offset = _downPos - te->localPosition;
|
|
|
|
|
-+ Vector2 offset = _downPos - _content->local2global(te->localPosition);
|
|
|
|
|
- float d = offset.dot(offset);
|
|
|
|
|
- if (_holded && (d >= _rad * _rad))
|
|
|
|
|
- {
|
|
|