Hi,
I work to create custom polymer element for few days now and I try to use
Polymer Gestures with drawing HTML5 canvas.
I listen those different events like this :
var events = [
// base events
'down',
'up',
'trackstart',
'track',
'trackend',
'tap',
'hold',
'holdpulse',
'release'
];
this.init();
events.forEach(function(en) {
PolymerGestures.addEventListener(this, en, function
(inEvent) {
switch (en) {
case 'down':
this.fire('myscript-canvas-down', {event:
inEvent, x : inEvent.x, y : inEvent.y});
break;
case 'track':
this.fire('myscript-canvas-track', {event:
inEvent, x : inEvent.x, y : inEvent.y});
break;
case 'up':
this.fire('myscript-canvas-up', {event:
inEvent, x : inEvent.x, y : inEvent.y});
break;
}
inEvent.preventDefault();
});
}, this);
But when I'm on the track case, inEvent.x and inEvent.y are undefined.
In fact, the structure of down and up event are the same but the structure
of the track event is different. I don't understand why event haven't got
an homogeneous structure ?
Please, I need a solution to get the pointer position on the event to draw
on my canvas on multi-platform browsers (Firefox, Chrome, etc.).
Thanks
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/53513d40-a0be-423d-88c9-a965e6adf2a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.