canvas: ios: still fiddling

This commit is contained in:
jean-emmanuel 2022-10-20 07:46:46 +02:00
parent 47694ee6c5
commit 06132d2005
2 changed files with 24 additions and 21 deletions

View file

@ -45,10 +45,14 @@ module.exports = {
// iOS-specific event properties
ev.touchType = e.touchType
// iOS-pollable event properties
for (var p of ['altitudeAngle', 'azimuthAngle', 'force']) {
Object.defineProperty(ev, 'get_' + p, {
enumerable: true,
value: ()=>e[p]
for (let p of ['altitudeAngle', 'azimuthAngle', 'force']) {
Object.defineProperty(ev, 'update_' + p, {
enumerable: false,
value: function(){
var changed = this[p] !== e[p]
if (changed) this[p] = e[p]
return changed
}
})
}
}