Well, duration could be part of the region properties set on creation in
order to compute the posution.

Enviado desde el móvil. Disculpa la brevedad y/o los posibles errores.
El 08/05/2014 09:11, "katspaugh" <notifications@github.com> escribió:

> In src/drawer.canvas.js:
>
> > +            my.fireEvent('region-over', region, e);
> > +        });
> > +        regionEl.addEventListener('mouseleave', function (e) {
> > +            my.fireEvent('region-leave', region, e);
> > +        });
> > +        regionEl.addEventListener('click', function (e) {
> > +            my.fireEvent('region-click', region, e);
> > +        });
> > +
> > +        this.updateRegion(region);
> > +    },
> > +
> > +    updateRegion: function (region) {
> > +        var regionEl = document.getElementById(region.id);
> > +        var left = Math.max(0, Math.round(
> > +                (region.startPosition / this.wavesurfer.getDuration()) * this.scrollWidth));
>
> I've been trying to avoid this kind of coupling (drawer calling
> wavesurfer). WaveSurfer object was the glue that called both drawer and
> backend, while neither of these two knew about the other two. Is there a
> way to not getting the duration every time you update a region?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/katspaugh/wavesurfer.js/pull/182/files#r12417330>
> .
>