Note that there are some explanatory texts on larger screens.

plurals
  1. POJerky drag action with kineticjs in firefox
    primarykey
    data
    text
    <p>I seem to have found a problem with Kineticjs in Firefox that produces slow and jerky dragging in the firefox browser (version 17.0.1) and kineticjs v4.3.0. FYI:I'm also running Fedora 17. This problem does not occur with Chrome. </p> <p>This may be a Firefox 17 problem. It does not occur on a 10 inch android 4.0.3 tablet running Firefox 15, or on an HTC-oneS phone running android 4.0.4 and Opera mobile 12.</p> <p>The demo code places two rect shapes in a layer and sets the topmost one to draggable. The draggable rectangle will not refresh its position on the screen unless the mouse drag slows below a certain threshold. It the mouse is continually moving fast enough the dragging rectangle never seems to update its place on the screen. The effect is a quite jerky drag.</p> <p>For the dragging to be jerky like this, the width and height of the stage must be > 256 and less than width = 1050 and height = 293. Un-commenting the line that sets the width and height of the stage to 256 makes the problem go away. The presence of the second rectangle is required. It can be draggable or not, it does not matter. If it is not there, the dragging is fine. There seems to be a qualitative rather than quantitative difference. Either it totally lags or it does not. </p> <p>Also, I tried placing the objects different layers (see commented lines), but that did not improve performance.</p> <p>Thanks in advance,</p> <p>Steve</p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;style&gt; body { margin: 0px; padding: 0px; } &lt;/style&gt; &lt;script type="text/javascript" src="/resources/kinetic.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="container"&gt;&lt;/div&gt; &lt;script&gt; var w = $("#container").innerWidth(); var h= $(window).innerHeight(); // w = 256; h= 256; // uncomment this line and dragging is smooth in firefox console.log("Stage size w:" + w + " h:" + h); var stage = new Kinetic.Stage({ container: 'container', width: w, height: h }); var gimage = new Kinetic.Rect({ x:10, y: 10, fill: '#00D2FF', // image: images["folder"], width: 36, height: 36, }); var fimage = new Kinetic.Rect({ x:30, y: 30, fill: '#A0D2FF', width: 36, height: 36, draggable: true }); var layer = new Kinetic.Layer(); //var layer2 = new Kinetic.Layer(); layer.add(gimage); layer.add(fimage); // layer2.add(fimage); stage.add(layer); // stage.add(layer2); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload