mirror of
https://github.com/scratchfoundation/Gestouch.git
synced 2024-11-23 07:47:59 -05:00
Now sending the touch to getHierarchy()
This commit is contained in:
parent
e696ed6e98
commit
c7278faa7d
4 changed files with 18 additions and 21 deletions
|
@ -217,7 +217,7 @@ package org.gestouch.core
|
|||
{
|
||||
throw new Error("Display list adapter not found for target of type '" + getQualifiedClassName(target) + "'.");
|
||||
}
|
||||
const hierarchy:Vector.<Object> = displayListAdapter.getHierarchy(target);
|
||||
const hierarchy:Vector.<Object> = displayListAdapter.getHierarchy(target, touch);
|
||||
const hierarchyLength:uint = hierarchy.length;
|
||||
if (hierarchyLength == 0)
|
||||
{
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package org.gestouch.core
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* @author Pavel fljot
|
||||
*/
|
||||
public interface IDisplayListAdapter extends IGestureTargetAdapter
|
||||
{
|
||||
function getHierarchy(target:Object):Vector.<Object>;
|
||||
function getHierarchy(target:Object, touch:Touch):Vector.<Object>;
|
||||
|
||||
function reflect():Class;
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package org.gestouch.extensions.native
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import flash.display.Stage;
|
||||
import flash.geom.Point;
|
||||
import flash.utils.Dictionary;
|
||||
import org.gestouch.core.IDisplayListAdapter;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import flash.display.Stage;
|
||||
import flash.utils.Dictionary;
|
||||
|
||||
import org.gestouch.core.IDisplayListAdapter;
|
||||
import org.gestouch.core.Touch;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @author Pavel fljot
|
||||
*/
|
||||
final public class NativeDisplayListAdapter implements IDisplayListAdapter
|
||||
|
@ -74,11 +74,11 @@ package org.gestouch.extensions.native
|
|||
}
|
||||
|
||||
|
||||
public function getHierarchy(genericTarget:Object):Vector.<Object>
|
||||
public function getHierarchy(genericObj:Object, touch:Touch):Vector.<Object>
|
||||
{
|
||||
var list:Vector.<Object> = new Vector.<Object>();
|
||||
var i:uint = 0;
|
||||
var target:DisplayObject = genericTarget as DisplayObject;
|
||||
var target:DisplayObject = genericObj as DisplayObject;
|
||||
while (target)
|
||||
{
|
||||
list[i] = target;
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
package org.gestouch.extensions.starling
|
||||
{
|
||||
import starling.display.DisplayObject;
|
||||
import starling.display.DisplayObjectContainer;
|
||||
import flash.utils.Dictionary;
|
||||
|
||||
import org.gestouch.core.IDisplayListAdapter;
|
||||
import org.gestouch.core.IDisplayListAdapter;
|
||||
import org.gestouch.core.Touch;
|
||||
|
||||
import flash.utils.Dictionary;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @author Pavel fljot
|
||||
*/
|
||||
final public class StarlingDisplayListAdapter implements IDisplayListAdapter
|
||||
|
@ -44,11 +41,11 @@ package org.gestouch.extensions.starling
|
|||
}
|
||||
|
||||
|
||||
public function getHierarchy(genericTarget:Object):Vector.<Object>
|
||||
public function getHierarchy(target:Object, touch:Touch):Vector.<Object>
|
||||
{
|
||||
var list:Vector.<Object> = new Vector.<Object>();
|
||||
var i:uint = 0;
|
||||
var target:DisplayObject = genericTarget as DisplayObject;
|
||||
var target:DisplayObject = target as DisplayObject;
|
||||
while (target)
|
||||
{
|
||||
list[i] = target;
|
||||
|
|
Loading…
Reference in a new issue