jcanvas icon indicating copy to clipboard operation
jcanvas copied to clipboard

if use css set canvas to half of it,and then can't drag,how to fixed this?

Open xmcase opened this issue 4 years ago • 1 comments

code like this, if I set canvas width 300px,height 300px, like this " ",and then can't drag again.

xmcase avatar Aug 20 '20 02:08 xmcase

@xmcase How are you setting the canvas width? It will skew the canvas coordinate system if you try to change the canvas width/height with CSS; that is probably why your drag is skewed.

Instead, you need to set the canvas width/height using jQuery's attr() or prop() methods:

$('#my-canvas').prop({
    width: 300,
    height: 300
});

caleb531 avatar Aug 22 '20 20:08 caleb531