kopiro / siriwave

The Apple® Siri wave-form replicated in a JS library.
http://kopiro.github.io/siriwave/
MIT License
1.63k stars 168 forks source link

How to draw a straight line before and after a wave using siriwave.js #8

Closed michaelgrc closed 9 years ago

michaelgrc commented 9 years ago

I've an issue using siriwave.js, I would like to have a line then the canvas which contains the wave but my problem is that the begin (at the left) and the end (at the right) of the wave both move. It result that I can't give a sense of continuity between my line and the canvas.

Here's a link to illustrate my problem : http://stackoverflow.com/questions/31235493/how-to-draw-a-straight-line-before-and-after-a-wave-using-siriwave-js

Does anyone knows how to fix that ? Many thanks

kopiro commented 9 years ago

We edited the global attenuation function to return values near to the 0, and hard-coded X values near to 2 to this:

if (Math.abs(i) >= 1.90) y = this.height_2;
michaelgrc commented 9 years ago

Thank you very much !!!!!