EaselJS: glitchy drag/drop

后端 未结 3 1485
情书的邮戳
情书的邮戳 2021-01-03 02:10

I have a bitmap inside of a container. When I drag the container the cursor changes to the edit-text shape, and also the image jumps to the bottom-right side of the cursor (

3条回答
  •  一整个雨季
    2021-01-03 03:01

    my solution

    (function(t, n) {
            layer.addEventListener('mousedown', function(evt) {
                var offset = {
                        x: t.x - evt.stageX,
                        y: t.y - evt.stageY
                    }
    
            t.addEventListener("pressmove", function(e2){
    
                            t.x =  offset.x + e2.stageX;
                            t.y =  offset.y + e2.stageY;
                            app.stage.update();
    
            })
    
    
    
        });
    
    
         })(layer, i);
    

    where layer is the layer, and i is not used.

提交回复
热议问题