From a1e1dee5a418fe322ee0c81a5bf97ca0ef5b08c2 Mon Sep 17 00:00:00 2001 From: obiot Date: Wed, 13 Mar 2013 22:51:47 +0800 Subject: [PATCH] Ticket #171 : fixed a 'null object' issue when enabling directRect --- src/entity/entity.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/entity/entity.js b/src/entity/entity.js index 40fb920df4..0423c02c80 100644 --- a/src/entity/entity.js +++ b/src/entity/entity.js @@ -1014,6 +1014,18 @@ return false; }, + /** + * @private + */ + getRect : function() { + if (this.renderable) { + // translate the renderable position since its + // position is relative to this entity + return this.renderable.getRect().translateV(this.pos); + } + return null; + }, + /** * object draw
* not to be called by the end user