Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.endTouchPoint = function (id) {
// Debug
if (!pointers.hasOwnProperty(id)) {
console.error('Pointer ' + id + ' does not exist.')
}
// For each removed touch.
commit()
delete pointers[id]
numPointers -= 1
if (numPointers === 0) {
// So numPointers was one.
// So high-level gesture ends.
this.emit('end', totalTransform)
// Return transforms to identity.
committedTransform = nudged.Transform.IDENTITY
totalTransform = nudged.Transform.IDENTITY
}
}
}
// Debug
if (!pointers.hasOwnProperty(id)) {
console.error('Pointer ' + id + ' does not exist.')
}
// For each removed touch.
commit()
delete pointers[id]
numPointers -= 1
if (numPointers === 0) {
// So numPointers was one.
// So high-level gesture ends.
this.emit('end', totalTransform)
// Return transforms to identity.
committedTransform = nudged.Transform.IDENTITY
totalTransform = nudged.Transform.IDENTITY
}
}
}
// Debug
if (!pointers.hasOwnProperty(id)) {
console.error('Pointer ' + id + ' does not exist.')
}
// For each removed touch.
commit()
delete pointers[id]
numPointers -= 1
if (numPointers === 0) {
// So numPointers was one.
// So high-level gesture ends.
this.emit('end', totalTransform)
// Return transforms to identity.
committedTransform = nudged.Transform.IDENTITY
totalTransform = nudged.Transform.IDENTITY
}
}
}
var Model = function () {
Emitter(this)
// For ongoing transformation, remember where the pointers started from
// and keep track where they are now. We store this information to
// the pointers variable. It has a property for each current pointer.
//
// Example:
// {
// 'pointerid': {dx: , dy: , rx: , ry}
// }
var pointers = {}
var numPointers = 0
// Cumulated transformation. Like a history.
var committedTransform = nudged.Transform.IDENTITY
// When the history is combined with the ongoing transformation,
// the result is total transformation.
var totalTransform = nudged.Transform.IDENTITY
// Limit the frequency of fired events
// TODO should be done outside of the Model.
var previousMoveDateNow = Date.now()
var commit = function () {
// Move ongoint transformation to the committed transformation so that
// the total transformation stays the same.
// Commit ongoingTransformation. As a result
// the domain and range of all pointers become equal.
var id, p, domain, range, t
domain = []
proto.toSpace = function () {
// Create a new SpacePoint at same location but represented on space coords.
//
// Implementation note:
// We already have coord. transf. from the current plane to the space:
// plane._T
var xySpace = this._T.transform(this.xy)
var spaceMock = { '_T': nudged.Transform.IDENTITY }
return new SpacePoint(spaceMock, xySpace)
}
var Model = function () {
Emitter(this)
// For ongoing transformation, remember where the pointers started from
// and keep track where they are now. We store this information to
// the pointers variable. It has a property for each current pointer.
//
// Example:
// {
// 'pointerid': {dx: , dy: , rx: , ry}
// }
var pointers = {}
var numPointers = 0
// Cumulated transformation. Like a history.
var committedTransform = nudged.Transform.IDENTITY
// When the history is combined with the ongoing transformation,
// the result is total transformation.
var totalTransform = nudged.Transform.IDENTITY
// Limit the frequency of fired events
// TODO should be done outside of the Model.
var previousMoveDateNow = Date.now()
var commit = function () {
// Move ongoint transformation to the committed transformation so that
// the total transformation stays the same.
// Commit ongoingTransformation. As a result
// the domain and range of all pointers become equal.
var id, p, domain, range, t
domain = []
var Model = function () {
Emitter(this)
// For ongoing transformation, remember where the pointers started from
// and keep track where they are now. We store this information to
// the pointers variable. It has a property for each current pointer.
//
// Example:
// {
// 'pointerid': {dx: , dy: , rx: , ry}
// }
var pointers = {}
var numPointers = 0
// Cumulated transformation. Like a history.
var committedTransform = nudged.Transform.IDENTITY
// When the history is combined with the ongoing transformation,
// the result is total transformation.
var totalTransform = nudged.Transform.IDENTITY
// Limit the frequency of fired events
// TODO should be done outside of the Model.
var previousMoveDateNow = Date.now()
var commit = function () {
// Move ongoint transformation to the committed transformation so that
// the total transformation stays the same.
// Commit ongoingTransformation. As a result
// the domain and range of all pointers become equal.
var id, p, domain, range, t
domain = []
// API v3.0.0
var nudged = require('nudged');
module.exports = nudged.Transform;
var nudged = require('nudged')
module.exports = nudged.Transform