/*
 * Copyright 2012 The Toolkitchen Authors. All rights reserved.
 * Use of this source code is goverened by a BSD-style
 * license that can be found in the LICENSE file.
 */

(function(scope) {
  var pointermap = {
    // pointers is an array of pointer states, ordered from oldest to youngest
    pointers: [],
    addPointer: function(inPointer) {
      this.pointers.push(inPointer);
    },
    removePointer: function(inId) {
      var p = this.getPointerById(inId);
      if (p) {
        var i = this.pointers.indexOf(p);
        this.pointers.splice(i, 1);
      }
    },
    getPointerById: function(inId) {
      for (var i = 0, p; (p = this.pointers[i]); i++) {
        if (p.id === inId) {
          return p;
        }
      }
    },
  };
  scope.pointermap = pointermap;
})(window.PointerEventShim);

@@ -95,17 +95,16 @@
 is gover
-e
 ned by a
@@ -620,26 +620,164 @@
     
-for (var i = 0, p;
+return this.pointers%5Bthis.getPointerIndex(inId)%5D;%0A    %7D,%0A    getPointerIndex: function(inId) %7B%0A      for (var i = 0, l = this.pointers.length, p; (i %3C l) &&
  (p 
@@ -850,17 +850,17 @@
  return 
-p
+i
 ;%0A      
@@ -875,18 +875,234 @@
   %7D%0A    
+  return -1;%0A    %7D,%0A    getPointerList: function() %7B%0A      return this.pointers;%0A    %7D,%0A    updatePointer: function(inId, inPointer) %7B%0A      var i = this.getPointerIndex(inId);%0A      this.pointers%5Bi%5D = inPointer;%0A    
 %7D
-,
 %0A  %7D;%0A  

Allow for pointer updates