meltingice / CamanJS

Javascript HTML5 (Ca)nvas (Man)ipulation
http://camanjs.com
BSD 3-Clause "New" or "Revised" License
3.55k stars 404 forks source link

problem with jquery slider #143

Open moham-MA-d opened 10 years ago

moham-MA-d commented 10 years ago

i want to manipulate brigthness of an image with jquery slider, but when jquery slider is triggerd the image transforms to a solid black, white, gray, dark gray, light gray and etc, depends on slider range.

`

 var $this;
 Caman("#canvas", "/Images/pic.png", function () {
            $this = this;
   });
 $("#slider-range").slider({
       min: -100,
       max: 100,
       value: 0,
       slide: function (event, ui) {
                $this.brightness(ui.value).render();  

       }
});

`

paradisehuman commented 10 years ago

I have this problem also ... Please help us ...

meltingice commented 10 years ago

Because of how the slider works, you're calling render before the previous render finishes. Make sure the render calls don't overlap.— Ryan LeFevre (@meltingice) LayerVault Software Engineer

On Tue, Apr 29, 2014 at 2:50 AM, Ahmad Khojasteh notifications@github.com wrote:

I have this problem also ...

Please help us ...

Reply to this email directly or view it on GitHub: https://github.com/meltingice/CamanJS/issues/143#issuecomment-41646204

moham-MA-d commented 10 years ago

What do you mean by that ? You mean after slider finished the change event , then I call caman function? Can you Explain by code ? Thanks in advance.

meltingice commented 10 years ago

Check out the code from the CamanJS site. It keeps track of when the Caman instance is rendering and doesn't allow render calls to overlap.