Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
range = []
for (id in pointers) {
if (pointers.hasOwnProperty(id)) {
p = pointers[id]
domain.push([p.dx, p.dy])
range.push([p.rx, p.ry]) // copies
// Move transformation from current pointers;
// Turn ongoingTransformation to identity.
p.dx = p.rx
p.dy = p.ry
}
}
// Calculate the transformation to commit and commit it by
// combining it with the previous transformations. Total transform
// then becomes identical with the commited ones.
t = nudged.estimateTSR(domain, range)
committedTransform = t.multiplyBy(committedTransform)
totalTransform = committedTransform
}
var updateTransform = function () {
// Calculate the total transformation from the committed transformation
// and the points of the ongoing transformation.
var id, p, domain, range, t
domain = []
range = []
for (id in pointers) {
if (pointers.hasOwnProperty(id)) {
p = pointers[id]
domain.push([p.dx, p.dy])
range.push([p.rx, p.ry])
}
}
// Calculate ongoing transform and combine it with the committed.
t = nudged.estimateTSR(domain, range)
totalTransform = t.multiplyBy(committedTransform)
}
var updateTransform = function () {
// Calculate the total transformation from the committed transformation
// and the points of the ongoing transformation.
var id, p, domain, range, t
domain = []
range = []
for (id in pointers) {
if (pointers.hasOwnProperty(id)) {
p = pointers[id]
domain.push([p.dx, p.dy])
range.push([p.rx, p.ry])
}
}
// Calculate ongoing transform and combine it with the committed.
t = nudged.estimateTSR(domain, range)
totalTransform = t.multiplyBy(committedTransform)
}