jcanvas
jcanvas copied to clipboard
if use css set canvas to half of it,and then can't drag,how to fixed this?
code like this, if I set canvas width 300px,height 300px, like this "
@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
});