Merge #317
Adding support for pooling Point objects in
PIXI.InteractionData.prototype.getLocalPosition

In certain use cases, such as dragging, events are fired off in rapid
succession.

Creating a new PIXI.Point in each event can cause memory usage to build up
and trigger a nasty garbage collection event.

This commit allows you to pass in a point instead of allocating a new one
each time the method is called.

Sample usage would be something like this:

var newPosition = new PIXI.Point();

myContainer.mousemove = function(data) {
	data.originalEvent.preventDefault();

	this.data.getLocalPosition(this.parent, newPosition);

	this.position.x = newPosition.x;
	this.position.y = newPosition.y;
}
1 parent 090ddc8 commit 78c23ff7b7c304ca00c181739c214e69dd5c80ca
@Chad Engler Chad Engler authored on 5 Aug 2014
Showing 1 changed file
View
src/pixi/InteractionData.js