I mean, that there should be an API that would say, how an element would 
scroll, if it was in place of for example a `<canvas>`. 


```
const scrollArea = new ScrollArea(canvasElement, {
  borderBox: 'unlimited', // Default would be the element
  //viewPort: '100#200'
});

scrollArea.addEventLisener('scrollStart', event => {
  console.log(event.endOffsetPosition);
  console.log(event.currenOffset);
  console.log(event.deltaX);
  // Possibly others
});
scrollArea.addEventLisener('scroll', () => {});
scrollArea.addEventLisener('scrollEnd', () => {});
```
Or, 
```
function step(timestamp) {
  canvas.translate(scrollArea.currentOffset.top, scrollArea.currentOffset.left);
  requestAnimationFrame(step);
}

requestAnimationFrame(step);
```
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to